Skip to content

Commit

Permalink
v2.5.0-demo兼容vue3细节优化
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileZXLee committed Jan 28, 2023
1 parent b619f74 commit 164de93
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- 在使用页面滚动时,在子组件内使用z-paging写法演示 -->
<!-- 使用页面滚动示例(vue) -->
<!-- 使用页面滚动演示(vue) -->
<template>
<view class="content">
<!-- 此时使用了页面的滚动,z-paging不需要有确定的高度,use-page-scroll需要设置为true -->
Expand Down
8 changes: 4 additions & 4 deletions z-paging/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}, {
"path": "pages/page-default-demo/page-default-demo",
"style": {
"navigationBarTitleText": "使用页面滚动示例",
"navigationBarTitleText": "使用页面滚动演示",
"enablePullDownRefresh": false

}
Expand Down Expand Up @@ -129,7 +129,7 @@
}, {
"path": "pages/page-default-demo-n/page-default-demo-n",
"style": {
"navigationBarTitleText": "使用页面滚动示例(nvue)",
"navigationBarTitleText": "使用页面滚动演示(nvue)",
"enablePullDownRefresh": true
}

Expand Down Expand Up @@ -221,14 +221,14 @@
}, {
"path": "pages/page-default-by-comp-demo/page-default-by-comp-demo",
"style": {
"navigationBarTitleText": "使用页面滚动且在子组件内使用z-paging示例",
"navigationBarTitleText": "使用页面滚动且在子组件内使用z-paging演示",
"enablePullDownRefresh": false
}

}, {
"path": "pages/popup-demo/popup-demo",
"style": {
"navigationBarTitleText": "在弹窗内使用z-paging示例",
"navigationBarTitleText": "在弹窗内使用z-paging演示",
"enablePullDownRefresh": false
}

Expand Down
6 changes: 1 addition & 5 deletions z-paging/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@
this.list = this.list.concat(indexList.listNvue);
// #endif
let vueVersion = 'vue2';
// #ifdef VUE3
vueVersion = 'vue3';
// #endif
uni.setNavigationBarTitle({
title: `z-paging(v${version}) in ${vueVersion}`
title: `z-paging(v${version})`
})
},
methods: {
Expand Down
8 changes: 4 additions & 4 deletions z-paging/pages/index/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ export default {
subTitle: ''
},
{
title: '使用页面滚动示例',
title: '使用页面滚动演示',
file: 'page-default-demo',
subTitle: ''
},
{
title: '使用页面滚动且在子组件内使用z-paging示例',
title: '使用页面滚动且在子组件内使用z-paging演示',
file: 'page-default-by-comp-demo',
subTitle: ''
},
{
title: '在弹窗内使用z-paging示例',
title: '在弹窗内使用z-paging演示',
file: 'popup-demo',
subTitle: 'z-paging的局部滚动'
},
Expand Down Expand Up @@ -126,7 +126,7 @@ export default {
subTitle: ''
},
{
title: '使用页面滚动示例(nvue)',
title: '使用页面滚动演示(nvue)',
file: 'page-default-demo-n',
subTitle: ''
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 使用页面滚动示例(nvue)(不建议,在nvue中,使用内置的list组件性能优于页面滚动,参见common-demo-n.nvue) -->
<!-- 使用页面滚动演示(nvue)(不建议,在nvue中,使用内置的list组件性能优于页面滚动,参见common-demo-n.nvue) -->
<!-- 注意,在nvue中使用页面滚动时,无法使用z-paging的下拉刷新(因为z-paging在nvue中的下拉刷新使用的是原生refresh组件,它只能在scroller和list中使用) -->
<!-- 若使用页面滚动时需要下拉刷新功能,请在pages.json中设置"enablePullDownRefresh": true开启页面下拉刷新功能 -->
<template>
Expand Down
2 changes: 1 addition & 1 deletion z-paging/pages/page-default-demo/page-default-demo.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 使用页面滚动示例(vue) -->
<!-- 使用页面滚动演示(vue) -->
<template>
<view class="content">
<!-- 此时使用了页面的滚动,z-paging不需要有确定的高度,use-page-scroll需要设置为true -->
Expand Down
2 changes: 1 addition & 1 deletion z-paging/pages/popup-demo/popup-demo.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- 在弹窗内使用z-paging示例(vue) -->
<!-- 在弹窗内使用z-paging演示(vue) -->
<template>
<view class="content">
<button size="mini" type="primary" @click="open">打开弹窗</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
const params = {
pageNo: pageNo,
pageSize: pageSize,
type: this.tabIndex + 1
type: this.current + 1
}
this.$request.queryList(params).then(res => {
//将请求的结果数组传递给z-paging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
:preloadPage="preloadPage" :cellHeightMode="cellHeightMode" :virtualScrollFps="virtualScrollFps" :virtualListCol="virtualListCol"
@query="_queryList" @listChange="_updateList" :mounted-auto-call-reload="false" style="height: 100%;">
<slot />
<template v-slot:header>
<template #header>
<slot name="header"/>
</template>
<template v-slot:cell="{item,index}">
<template #cell="{item,index}">
<slot name="cell" :item="item" :index="index"/>
</template>
<template v-slot:footer>
<template #footer>
<slot name="footer"/>
</template>
</z-paging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export default {
this.$nextTick(()=>{
this._updateCustomRefresherHeight();
})
}, 100)
}, c.delayTime)
}
// #endif
return showRefresher;
Expand Down

0 comments on commit 164de93

Please sign in to comment.