<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例

        來源:懂視網 責編:小采 時間:2020-11-27 22:02:32
        文檔

        微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例

        微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例:本文實例講述了微信小程序實現swiper切換卡內嵌滾動條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o
        推薦度:
        導讀微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例:本文實例講述了微信小程序實現swiper切換卡內嵌滾動條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o

        本文實例講述了微信小程序實現swiper切換卡內嵌滾動條不顯示的方法。分享給大家供大家參考,具體如下:

        index.wxml文件:

        <view class="swiper-tab">
         <view class="swiper-tab-item {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">為你推薦</view>
         <view class="swiper-tab-item {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">新品上架</view>
         <view class="swiper-tab-item {{currentTab==2 ? 'on' : ''}}" data-current="2" bindtap="swichNav">最熱商品</view>
        </view>
        <swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:{{clientHeight?clientHeight-'40'+'px':'auto'}}" bindchange="bindChange" >
         <swiper-item>
         <scroll-view scroll-y="{{true}}" style="height: {{clientHeight?clientHeight+'px':'auto'}}">
         <view style='height:200px'>為你推薦</view>
         <view style='height:200px'>為你推薦</view>
         <view style='height:200px'>為你推薦</view>
         <view style='height:200px'>為你推薦</view>
         <view style='height:200px'>為你推薦</view>
         </scroll-view>
         </swiper-item>
         <swiper-item>
         <view>新品上架</view>
         </swiper-item>
         <swiper-item>
         <view>最熱商品</view>
         </swiper-item>
        </swiper>
        
        

        index.wxss文件:

        /**index.wxss**/
        .userinfo {
         display: flex;
         flex-direction: column;
         align-items: center;
        }
        .userinfo-avatar {
         width: 128rpx;
         height: 128rpx;
         margin: 20rpx;
         border-radius: 50%;
        }
        .userinfo-nickname {
         color: #aaa;
        }
        .usermotto {
         margin-top: 200px;
        }
        .swiper-tab {
         width: 100%;
         text-align: center;
         line-height: 80rpx;
         margin-top:10rpx;
         margin-bottom: 20rpx;
        }
        .swiper-tab-item {
         font-size: 30rpx;
         display: inline-block;
         width: 33.33%;
         color: #666;
        }
        .on {
         color: #FEA611;
         border-bottom: 5rpx solid #FEA611;
        }
        .swiper-box {
         display: block;
         height: 100%;
         width: 100%;
         overflow: hidden;
        }
        .swiper-box view {
         text-align: center;
        }
        
        

        index.js文件:

        //獲取應用實例
        const app = getApp()
        Page({
         data: {
         motto: 'Hello World',
         userInfo: {},
         hasUserInfo: false,
         canIUse: wx.canIUse('button.open-type.getUserInfo'),
         clientWidth: 0,
         clientHeight: 0,
         // tab切換
         currentTab: 0
         },
         //事件處理函數
         bindViewTap: function () {
         wx.navigateTo({
         url: '../logs/logs'
         })
         },
         onLoad: function () {
         var that = this;
         wx.getSystemInfo({
         success: function (res) {
         that.setData({
         clientHeight: res.windowHeight
         });
         }
         });
         if (app.globalData.userInfo) {
         this.setData({
         userInfo: app.globalData.userInfo,
         hasUserInfo: true
         })
         } else if (this.data.canIUse) {
         // 由于 getUserInfo 是網絡請求,可能會在 Page.onLoad 之后才返回
         // 所以此處加入 callback 以防止這種情況
         app.userInfoReadyCallback = res => {
         this.setData({
         userInfo: res.userInfo,
         hasUserInfo: true
         })
         }
         } else {
         // 在沒有 open-type=getUserInfo 版本的兼容處理
         wx.getUserInfo({
         success: res => {
         app.globalData.userInfo = res.userInfo
         this.setData({
         userInfo: res.userInfo,
         hasUserInfo: true
         })
         }
         })
         }
         },
         getUserInfo: function (e) {
         console.log(e)
         app.globalData.userInfo = e.detail.userInfo
         this.setData({
         userInfo: e.detail.userInfo,
         hasUserInfo: true
         })
         },
         bindChange: function (e) {
         var that = this;
         that.setData({ currentTab: e.detail.current });
         },
         swichNav: function (e) {
         var that = this;
         if (this.data.currentTab === e.target.dataset.current) {
         return false;
         } else {
         that.setData({
         currentTab: e.target.dataset.current
         })
         }
         }
        })
        
        

        希望本文所述對大家微信小程序開發有所幫助。

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例

        微信小程序實現swiper切換卡內嵌滾動條不顯示的方法示例:本文實例講述了微信小程序實現swiper切換卡內嵌滾動條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 毛片免费在线播放| 日韩免费电影网站| 日本高清免费aaaaa大片视频| 亚洲精品mv在线观看| 3344免费播放观看视频| 亚洲精品乱码久久久久久下载| 男人进去女人爽免费视频国产| 亚洲AV综合色区无码另类小说| 日韩精品无码免费专区网站| 亚洲热线99精品视频| 青青草无码免费一二三区| 久久精品蜜芽亚洲国产AV| 色欲A∨无码蜜臀AV免费播| 亚洲黑人嫩小videos| 成人免费毛片内射美女APP| 亚洲xxxx视频| 免费一级做a爰片性色毛片| a级毛片免费在线观看| 亚洲国产国产综合一区首页| 2020久久精品国产免费| 亚洲欧美第一成人网站7777| 亚洲AV无码成H人在线观看| A片在线免费观看| 亚洲激情视频图片| 四虎影视免费永久在线观看| 久久精品无码专区免费| 久久亚洲国产精品成人AV秋霞 | 中文字幕免费在线看电影大全 | 国产精品亚洲а∨无码播放麻豆 | 中文字幕免费人成乱码中国| 777亚洲精品乱码久久久久久 | 免费一级毛片在线观看| a级毛片免费观看视频| 丁香婷婷亚洲六月综合色| 亚洲av日韩av欧v在线天堂| 久久香蕉国产线看免费| 亚洲AV无码一区二区三区久久精品 | 色欲A∨无码蜜臀AV免费播| 国产亚洲精品bv在线观看| 亚洲日韩国产精品乱| 青青青国产在线观看免费|