<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
        主站蜘蛛池模板: 国产精品亚洲天堂| 四虎永久免费地址在线网站| 亚洲国产精品激情在线观看 | 波多野结衣久久高清免费| 免费网站看av片| 一个人看的在线免费视频| ass亚洲**毛茸茸pics| 亚洲av无码专区国产乱码在线观看| 又粗又硬又黄又爽的免费视频| 国产92成人精品视频免费| 久久久久免费精品国产| 人妻免费久久久久久久了| 亚洲狠狠婷婷综合久久蜜芽| 亚洲国产精品久久丫| 亚洲2022国产成人精品无码区| 亚洲日本乱码在线观看| 亚洲av区一区二区三| 国产一级特黄高清免费大片| 天天摸天天操免费播放小视频| 亚洲w码欧洲s码免费| 8x网站免费入口在线观看| 久久国产精品国产自线拍免费| 中文日本免费高清| 一级毛片a免费播放王色| 国产亚洲福利一区二区免费看 | 99精品一区二区免费视频| 华人在线精品免费观看| 国产乱妇高清无乱码免费| 亚洲国产精品久久丫| 亚洲字幕在线观看| 亚洲黄色在线观看| 久久精品亚洲精品国产色婷| 亚洲激情在线视频| 亚洲AV日韩精品久久久久久久 | 国产成人无码精品久久久免费| 三年片在线观看免费观看大全中国| 精品国产日韩亚洲一区在线| 特级毛片免费播放| www成人免费视频| 久久毛片免费看一区二区三区| 青青操免费在线视频|