<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關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題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關(guān)鍵字專題關(guān)鍵字專題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
        當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

        微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例

        來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:02:32
        文檔

        微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例

        微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例:本文實(shí)例講述了微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o
        推薦度:
        導(dǎo)讀微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例:本文實(shí)例講述了微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o

        本文實(shí)例講述了微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法。分享給大家供大家參考,具體如下:

        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文件:

        //獲取應(yīng)用實(shí)例
        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
         },
         //事件處理函數(shù)
         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 是網(wǎng)絡(luò)請(qǐng)求,可能會(huì)在 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
         })
         }
         }
        })
        
        

        希望本文所述對(duì)大家微信小程序開發(fā)有所幫助。

        聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例

        微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法示例:本文實(shí)例講述了微信小程序?qū)崿F(xiàn)swiper切換卡內(nèi)嵌滾動(dòng)條不顯示的方法。分享給大家供大家參考,具體如下: index.wxml文件: <view class=swiper-tab> <view class=swiper-tab-item {{currentTab==0 ? 'o
        推薦度:
        標(biāo)簽: 微信小程序 的辦法 示例
        • 熱門焦點(diǎn)

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 日韩在线免费看网站| 中文字幕亚洲第一| 亚洲视频免费在线观看| 成人a毛片视频免费看| 国产麻豆剧传媒精品国产免费| 亚洲人成无码网站在线观看 | 亚洲精品无码乱码成人| 一级成人a做片免费| 亚洲电影日韩精品 | 亚洲AV乱码一区二区三区林ゆな | 十八禁的黄污污免费网站| 亚洲乱码一区二区三区在线观看| 久久99国产乱子伦精品免费| 亚洲国产精品无码一线岛国| 中文字幕av免费专区| 亚洲精品成人片在线播放| 日韩免费高清大片在线| 久久亚洲AV成人无码软件| 91精品视频在线免费观看| 亚洲中文字幕人成乱码| 免费黄色毛片视频| 青青免费在线视频| 国产亚洲精品岁国产微拍精品| 国产成人无码区免费内射一片色欲| 久久精品7亚洲午夜a| 精品香蕉在线观看免费| 亚洲中文字幕无码中文| 亚洲国产小视频精品久久久三级| A级毛片成人网站免费看| 777亚洲精品乱码久久久久久 | 国产无遮挡吃胸膜奶免费看视频| 亚洲最大AV网站在线观看| 亚洲1234区乱码| 五月天婷亚洲天综合网精品偷| 中文在线免费不卡视频| 亚洲精品无码久久久久久久| 午夜视频在线观看免费完整版| 美女视频黄a视频全免费网站色| 亚洲精品成人片在线播放| 久久成人国产精品免费软件| 亚洲国产精品网站在线播放|