赞
踩
- <view class="uni-flex uni-row jksp-top">
- <scroll-view class="scroll1" scroll-x="true">
- <view :class="currentTab==index ? 'select' : ''" :data-current="index" @click="swichNav" v-for="(item,index) in scoll" :key='index' class="text1">{{item.txt}}
- </view>
- </scroll-view>
- </view>
- <swiper :current="currentTab" @change="bindChange" style="height:470rpx;margin-top:20rpx;">
- <swiper-item>
- 22
- </swiper-item>
- <swiper-item>
- 33
- </swiper-item>
- </swiper>
-
- <script>
- export default {
- data() {
- return {
- currentTab: 0,
-
- scoll: [{
- txt: '精选1'
- }, {
- txt: '精选2'
- }],
- }
- }
-
- methods: {
- // 滑动页面同步tab栏
- bindChange: function(e) {
- this.currentTab = e.detail.current
- },
- //点击tab切换
- swichNav: function(e) {
- var that = this;
- if (this.currentTab === e.target.dataset.current) {
- return false;
- } else {
- this.currentTab = e.target.dataset.current
- }
- }
- }
- }
- <script>

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。