[英]Working with bootstrap modal and ember
我有一個引導程序模態的工作版本,它會打開一個看起來像這樣的json的嵌套列表(“選項”):
{
product: [{
id: 1,
title: 'Some dope shoes',
options: [
{ id: 1, name: 'Color' },
{ id: 2, name: 'Size' }
]
},
{
id: 2,
title: 'Some dope',
options: [
{ id: 3, name: 'Lenght' },
{ id: 4, name: 'Flavor' }
]
}
]
}
我已經使用任何文件組件為模板編寫了模態的所有內容。 訣竅是使uniq模態ID。 網址看起來像:
<a href="#" data-toggle="modal" data-target="#ma-modal{{optionid}}" title={{title}}>{{mmmh}}</a>
模態看起來像:
<div class="modal" id="ma-modal{{optionid}}"></div>
我對這段代碼沒有信心,因為我正在學習余燼,所以我想知道在沒有任何文件組件的情況下在模板中執行所有這些操作是否不好?
在我看來,使用ID玩是一種hack。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.