任何人都可以帮助我,因为我是 rivets.js 的新手。我在我的 html 页面中访问 JSON 响应时遇到问题。我可以使用 account.subTotal 访问直到“subTotal”键,但无法访问货币(内部键)等。下面是我的 JSON 响应:
[
{
"subTotal": [
{
"currency": "dollar",
"balance": "979,18"
}]
,
"productList": [
{
"acctno": "123456789",
"Name": "abc",
}
]
},
{
"subTotal": [
{
"currency": "dollar",
"balance": "979,18"
}]
,
"productList": [
{
"acctno": "123456789",
"Name": "abc",
}
]
},
{
"subTotal": [
{
"currency": "dollar",
"balance": "979,18"
}]
,
"productList": [
{
"acctno": "123456789",
"Name": "abc",
}
]
}
]
以下是我在 HTML 模板中添加的方式:
<ul>
<li data-each-account="model">
<a href="#">
<strong data-text="account.subTotal.currency"></strong><br/>
</a>
</li>
</ul>
提前致谢 !