gpt4 book ai didi

dust.js - 如何在 dust 中使用动态键映射属性文件中的内容

转载 作者:行者123 更新时间:2023-12-01 12:38:22 24 4
gpt4 key购买 nike

我从 Controller 获取一个 JSON,基于这个 JSON 的值,我想在我的灰尘文件中设置 key ,这样这个 key 就可以访问属性文件中的数据。

例如,我从 Controller 获取“step”。

   {
step: step1
}

我想把 key 放在灰尘里:

   {@pre type="content" key="{step}"/}

在我拥有的属性(property)中

step1=This is dynamic key
step2=print this

但我的第 1 步已经尘土飞扬。它没有访问键的值。谁能建议我如何在这种情况下显示与键关联的值。

最佳答案

{@pre type="content" key=step/}

step 是一个变量时。要设置字符串,例如:'stackoverflow',请尝试:

{@pre type="content" key="stackoverflow"/}

关于dust.js - 如何在 dust 中使用动态键映射属性文件中的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27479054/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com