提交 4ac6aa4c 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

修改 sticky-section 示例覆盖iOS的 [issues](https://issues.dcloud.net.cn/pages/issues/detail?id=2787)

上级 051dcc42
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<button @click="gotoStickyHeader('C')" size="mini">跳转到id为C的sticky-header位置上</button> <button @click="gotoStickyHeader('C')" size="mini">跳转到id为C的sticky-header位置上</button>
</list-item> </list-item>
<list-item style="padding: 10px; margin: 5px 0;align-items: center;" :type = 20> <list-item style="padding: 10px; margin: 5px 0;align-items: center;" :type = 20>
<button @click="appendSectionItem(0)" size="mini">A section 新增5条内容</button> <button @click="appendSectionItem(0)" size="mini">第一组 section 新增5条内容</button>
</list-item>
<list-item style="padding: 10px; margin: 5px 0;align-items: center;" :type = 20>
<button @click="deleteSection()" size="mini">删除第一组 section</button>
</list-item> </list-item>
<sticky-section v-for="(section) in sectionArray" :key="section.name" :padding="sectionPadding" :push-pinned-header="true"> <sticky-section v-for="(section) in sectionArray" :key="section.name" :padding="sectionPadding" :push-pinned-header="true">
<sticky-header :id="section.name"> <sticky-header :id="section.name">
...@@ -34,7 +37,7 @@ ...@@ -34,7 +37,7 @@
export default { export default {
data() { data() {
return { return {
data: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'], data: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'],
sectionPadding: [0, 10, 0, 10] as Array<number>, sectionPadding: [0, 10, 0, 10] as Array<number>,
scrollIntoView: "", scrollIntoView: "",
scrolling: false, scrolling: false,
...@@ -94,6 +97,9 @@ ...@@ -94,6 +97,9 @@
{text: data.name+"--item--content----new5--"+this.appendId} as sectionListItem {text: data.name+"--item--content----new5--"+this.appendId} as sectionListItem
] as sectionListItem[] ] as sectionListItem[]
data.list.unshift(...list) data.list.unshift(...list)
},
deleteSection() {
this.sectionArray.shift()
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册