vue.js - Vue js如何在v-for循环中渲染大括号变量
问题描述
在我的数据对象中
items: [
{ name: "Breakfast", comp: "breakfastItems" },
{ name: "Lunch", comp: "lunchItems" },
{ name: "Dinner", comp: "dinnerItems" },
{ name: "Dessert", comp: "desertItems" }
]
其中comp是计算属性。在我的组件模板中,我想使用 for 循环来实现这样的目标。
<span v-for="n in items">
{{n.comp}}
</span>
这不起作用,因为我需要在渲染时添加 {{}}。我怎么做?
解决方案
推荐阅读
- html - 添加工具提示不在css中显示div
- windows - 从 Windows Server 2012 R2 发送 SSL HTTP 请求
- python - 它确实打印输出,但为什么它没有写入文件?
- python - Python psycopg2删除具有多个where条件的记录
- c# - 使用 Math.Net 的互相关
- uwp - Clipboard.SetContent() 远程过程调用失败
- azure-eventhub - 我正在将 Eventhub 日志捕获到存储帐户中,但它以 avro 编码格式显示。我期待在Json
- html - 服务器不读取 css 和 js 文件
- python - AttributeError:“Legend”对象没有“可拖动”属性
- javascript - 需要在单击按钮时显示 gifloader,该按钮在后端执行一些处理并在处理完成后清除