uniapp + uview:使用uniapp的swiper和uview的tabs标签组合实现
Tabs 标签 | uview-plus 3.0 - 全面兼容nvue的uni-app生态框架 - uni-app UI框架
```vue
:duration='300'> {{item.name}}
import {
onMounted,
onUnmounted,
ref,
reactive,
computed,
markRaw,
getCurrentInstance,
nextTick
} from "vue";
import {
formatDateByDate,
Toast
} from "@/utils/utils.js";
import store from "@/store/index.js";
import {
onPullDownRefresh,
onReachBottom,
onShow,
onLoad
} from "@dcloudio/uni-app";
const {
proxy
} = getCurrentInstance();
const state = reactive({
list: [{
name: '全部',
id: ''
},{
name: '组筹备阶段',
id: '1'
},{
name: '准备阶段',
id: '2'
},{
name: '实施阶段',
id: '3'
},{
name: '收尾阶段',
id: '4'
},],
current: 0,
});
// tab切换
const clickTab = (e) => {
state.current = e.index
}
// 页面滑动
const swiperChange = (e) => {
state.current = e.detail.current
}
.main {
height: 100%;
background: #EFF4FB;
box-sizing: border-box;
overflow: hidden;
.swiper-box {
height: calc(100vh - 224rpx);
padding: 24rpx 24rpx;
box-sizing: border-box;
}
}
```
猜你喜欢
网友评论
- 搜索
- 最新文章
- 热门文章