vue.js - 如何继承Vue Json
问题描述
json格式
{
"font_color": "red",
}
我收到了带有 json 的颜色,我想立即将其应用于 html。
<h2 style="color:{{msg.font_color}}">Test</h2>
解决方案
<h2 v-bind:style="{ color: `${msg.font_color}` }">Test</h2>
推荐阅读
- c - 我想使用 C 和 HTTP-Authentication 连接到网站
- c# - 如何尝试从没有尾随`/`的uri创建一个url?
- javascript - 使用 js-cookie 和 JSON.parse 从 cookie 中设置和获取数组
- java - 具有特定 ID 的模拟子演员 Akka Java
- node.js - 如何获取 appium-chromedriver 版本
- python - 根据特定条件删除 numpy 数组的行
- javascript - React 不会从 url 加载图像
- java - 无法从 TemporalAccessor 获取 ZoneOffset:{},ISO,Europe/Berlin 解析为 java.time.format.Parsed 类型的 2019-12-26
- python - 如何将 Select * Postgres/Redshift 查询结果放入字典(列/值)
- python - pandas.to_sql 写入零而不是整数/浮点值