gpt4 book ai didi

javascript - 打印 jade 文件中的变量

转载 作者:搜寻专家 更新时间:2023-10-31 22:57:46 25 4
gpt4 key购买 nike

我想为我的表单 textarea 打印默认值我有下面的代码

 textarea(class="form-control",name="details")
if restaurant.details
#{restaurant.details}

但是如果设置了我的值(restaurant.details),它会像标签而不是文本一样出现,如何在我的文本区域内打印文本?

最佳答案

使用|操作符:

 textarea(class="form-control",name="details")
if restaurant.details
| #{restaurant.details}

codepen

来自docs

The simplest way of adding plain text to templates is to prefix the line with a | character (pronounced "pipe").

关于javascript - 打印 jade 文件中的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21801618/

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