mirror of
https://gitee.com/TSpecific/tuniao-ui.git
synced 2026-03-07 08:14:01 +08:00
新增10+页面模板
新增form表单部分组件的演示代码 新增图标 添加第三方开发插件演示(所属权归属第三方) 新增tn-scroll-view下拉组件开发(会员) 新增tn-stack-swiper堆叠轮播添加垂直滚动属性(会员) 新增tn-waterfall瀑布流组件(会员) 新增tn-tree-view树形菜单组件(会员) 新增tn-cascade-selection级联选择组件(会员) 新增tn-custom-swiper组件(会员【实验室】) 新增tn-lazy-load懒加载组件 新增tn-load-more加载更多组件 新增tn-sekeleton骨架屏组件 新增tn-empty空白页组件 新增tn-landscape压屏窗组件 新增tn-verification-code-input验证码输入组件 新增tn-goods-nav商品导航组件 修复tn-slider在tn-form-item下在H5端无法滑动的bug 修复tn-swipe-action-item点击回调事件中无法读取name属性的bug 修复群友已反馈的bug 优化部分页面在iphone上底部确实的问题
This commit is contained in:
102
componentsPage/lazy-load/lazy-load.vue
Normal file
102
componentsPage/lazy-load/lazy-load.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<view class="components-lazy-load">
|
||||
<!-- 顶部自定义导航 -->
|
||||
<tn-nav-bar fixed>懒加载</tn-nav-bar>
|
||||
|
||||
<!-- 页面内容 -->
|
||||
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
|
||||
<view class="content">
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view class="item">
|
||||
<tn-lazy-load
|
||||
:index="index"
|
||||
:image="item.src"
|
||||
:threshold="-450"
|
||||
:height="400"
|
||||
imgMode="aspectFill"
|
||||
></tn-lazy-load>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<tn-load-more :status="status" @loadmore="getData"></tn-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ComponentsLazyLoad',
|
||||
data() {
|
||||
return {
|
||||
status: 'loadmore',
|
||||
list: [],
|
||||
data: [
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/bag1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/bag2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/banner3.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/card.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/computer1.jpg' },
|
||||
{ src: 'error.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/computer2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/content.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/cup1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/cup2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/office.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/phonecase1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/phonecase2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/pillow.jpg' },
|
||||
{ src: 'error.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/pillow2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/prototype1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/prototype2.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/sticker.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/watch1.jpg' },
|
||||
{ src: 'https://tnuiimage.tnkjapp.com/shop/watch2.jpg' },
|
||||
{ src: 'error.jpg' }
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getData()
|
||||
},
|
||||
onReachBottom() {
|
||||
uni.$emit('tOnLazyLoadReachBottom')
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let index = 0
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
index = this.$t.number.random(0, this.data.length - 1)
|
||||
this.list.push({
|
||||
src: this.data[index].src
|
||||
})
|
||||
}
|
||||
this.status = 'loadmore'
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
padding: 30rpx;
|
||||
|
||||
.item {
|
||||
flex: 0 0 335rpx;
|
||||
height: 400rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user