我想使用的應用程序佈局「nav-list-detail」的聚合物,但不知道如何從填入內容根據列表選擇在高分子
<!-- List -->
<paper-menu class="list" on-iron-activate="_listTap">
<template is="dom-repeat" items="{{items}}">
<paper-item><span class="paper-font-body1">{{item}}</span></paper-item>
</template>
</paper-menu>
選擇的東西,有它填充
<!-- Main Content -->
<div class="content"></div>
我的模型是
<script>
(function() {
Polymer({
is: 'nav-list-detail',
_computeListWidth: function(isMobile) {
// when in mobile screen size, make the list be 100% width to cover the whole screen
return isMobile ? '100%' : '33%';
},
_listTap: function() {
this.$.mainDrawerPanel.closeDrawer();
},
properties: {
items: {
type: Array,
notify: true,
}
},
ready: function() {
this.items = [
'Item 1',
'Item 2',
'Item 3',
'Item 4',
'Item 5'
]
}
});
})();
</script>
我與聚合物(尤其是1.0)相當新的,因此它可能b一個簡單的解決方案,我只是想念。
你得原諒我的小白的煩躁,但我仍然不清楚,當我點擊重複''我怎麼知道哪一個項目,所以我可以在''中填充數據。最終,我的數組將是一個對象數組,我將用它來構建該div中的內容。 –