国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

uniapp-vue-微信小程序 可拖動(dòng)底部抽屜

這篇具有很好參考價(jià)值的文章主要介紹了uniapp-vue-微信小程序 可拖動(dòng)底部抽屜。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

微信小程序 要求:底部上劃到一定位置 停止,我用的是hbuildX插件實(shí)現(xiàn),插件比較簡(jiǎn)單,具體使用往下看

實(shí)現(xiàn)效果:https://download.csdn.net/download/YaRuu/87600627?spm=1001.2014.3001.5501

插件地址:https://ext.dcloud.net.cn/plugin?id=7921

插件下載到hbuildX里的需要的項(xiàng)目里,就可以直接用了

uniapp抽屜組件,微信小程序,vue.js,uni-app,Powered by 金山文檔

代碼實(shí)現(xiàn):文章來源地址http://www.zghlxwxcb.cn/news/detail-673790.html

<ww-bottom-drawerapp ref="drag" :proportionShow='proportionvc' :dragHandleHeight="handleHeight"
                           :isExpand="mExpand"
                           @callExpand="onCallExpand" :canDrag="canDarg()" :dragLength="dragLength"
                           :transitionTime='transitionTime' :menuHeight='menuHeight'>
        <view class="nav">
          <!-- 選項(xiàng)卡水平方向滑動(dòng),scroll-with-animation是滑動(dòng)到下一個(gè)選項(xiàng)時(shí),有一個(gè)延時(shí)效果 -->
          <scroll-view class="tab-scroll"  scroll-x="true" scroll-with-animation :scroll-left="scrollLeft">
            <view class="tab-scroll_box">
              <!-- 選項(xiàng)卡類別列表 -->
              <view class="tab-scroll_item" v-for=" (item,index) in optionsTabs" :key="index" @click="chenked(index)">
                <view class="cont-top" @click="getTabbar(item)" v-if="!(isTabs.key === item.key)">
                  <img class="cont-top-img" :src="getImg(item.iconPath+'.png')" alt="">
                  {{ item.value }}
                </view>
                <view class="cont-topS" @click="getTabbar(item)" v-else>
                  <img class="cont-top-img" :src="getImg(item.iconPath+'S.png')" alt="">
                  {{ item.value }}
                </view>
              </view>
            </view>
          </scroll-view>
        </view>
        <slot>
          <!-- 填充內(nèi)容 -->
          <scroll-view :scroll-top="scrollTop" scroll-y="true"
                       :style="'width: 100%;height :'+  (menuHeight + 'px')  "
                        @scroll="scroll">
            <uni-grid :column="4" :highlight="false" :showBorder="false" v-if="isTabs.key==='景點(diǎn)'">
              <uni-grid-item  v-for="(item, index) in list"
                             :key="index"
                              :index="index">
                <view class="popup-bot">
? ? ? ? ? ? ? ? ? ? <!--循環(huán)列表-->
                      <view>{{item}}</view>
                </view>
              </uni-grid-item>
            </uni-grid>
          </scroll-view>
        </slot>
      </ww-bottom-drawerapp>
data(){
? ?return{
      proportionvc: 0.4, //抽屜初始顯示的位置,內(nèi)容的百分比
      handleHeight: 20, //抽屜頂部邊框高度,可以設(shè)置0,隱藏
      mExpand: false,
      dragLength: 100,
      transitionTime: 0.3,
      menuHeight: 450,//計(jì)算預(yù)設(shè)菜單的高度 px
      scrollTop: 0, //支付寶使用
      mscrollTop: 0, 
? ?}
},
 methods: {
    //nvue對(duì)top動(dòng)畫支持不夠,使用css的其他的動(dòng)畫轉(zhuǎn)換
    styleCss() {
      if (this.mExpand) {
        return this.targetCss();//'width: calc(50%);'
      } else {
        return this.originCss();//`width: calc(100% - 20px);`
      }
    },
    targetCss() {
      return "transform: translateY(100%);transition-property: transform;transition-duration: 1s;"
    },
    originCss() {
      return "transform: translateY(0px);transition-property: transform;transition-duration: 1s;"
    },
    canDarg() {
      // #ifdef MP-ALIPAY
      return this.mscrollTop < 30
      // #endif
      return true
    },
    scroll: function (e) {
      this.mscrollTop = e.detail.scrollTop
    },
    onCallExpand(e) { //展開搜索的回調(diào)監(jiān)聽
      this.mExpand = e.value
    },
}
uniapp抽屜組件,微信小程序,vue.js,uni-app,Powered by 金山文檔
uniapp抽屜組件,微信小程序,vue.js,uni-app,Powered by 金山文檔

到了這里,關(guān)于uniapp-vue-微信小程序 可拖動(dòng)底部抽屜的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包