任何人都可以帮助我,因为我是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>
提前致谢!
答案 0 :(得分:0)
data-text="account.subTotal || attr currency">