12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <view class="zp-swiper-item-container">
- <z-paging ref="paging" :fixed="false" @query="_queryList" @listChange="_updateList" :mounted-auto-call-reload="false"
- style="height: 100%;">
- <slot></slot>
- </z-paging>
- </view>
- </template>
- <script>
- import zPaging from '../z-paging/z-paging'
- export default {
- name: "z-paging-swiper-item",
- components: {
- zPaging
- },
- data() {
- return {
- firstLoaded: false
- }
- },
- props: {
-
- tabIndex: {
- type: Number,
- default: function() {
- return 0
- }
- },
-
- currentIndex: {
- type: Number,
- default: function() {
- return 0
- }
- },
- },
- watch: {
- currentIndex: {
- handler(newVal, oldVal) {
- if (newVal === this.tabIndex) {
-
- if (!this.firstLoaded) {
- this.$nextTick(()=>{
- setTimeout(() => {
- this.$refs.paging.reload();
- }, 5);
- })
- }
- }
- },
- immediate: true
- }
- },
- methods: {
- reload(data) {
- this.$refs.paging.reload(data);
- },
- complete(data) {
- this.firstLoaded = true;
- this.$refs.paging.complete(data);
- },
- _queryList(pageNo, pageSize) {
- this.$emit('query', pageNo, pageSize);
- },
- _updateList(list) {
- this.$emit('updateList', list);
- }
- }
- }
- </script>
- <style scoped>
- .zp-swiper-item-container {
-
- height: 100%;
-
-
- flex: 1;
-
- }
- </style>
|