<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
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        小程序實現左滑刪除效果

        來源:懂視網 責編:小OO 時間:2020-11-27 21:53:13
        文檔

        小程序實現左滑刪除效果

        代碼如下:html;<;view class="container">;<;view class="main">;<;view class="main_item">;<;movable-area>;<;movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{x}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">;<。
        推薦度:
        導讀代碼如下:html;<;view class="container">;<;view class="main">;<;view class="main_item">;<;movable-area>;<;movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{x}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">;<。

        代碼如下:

        html

        <view class="container">
         <view class="main">
         <view class="main_item">
         <movable-area>
         <movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{x}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">
         <view class="main_item_content ">
         左滑刪除
         </view>
         </movable-view>
         </movable-area>
         <view class="delete_btn " data-productIndex="{{index}} " bindtap="handleDeleteProduct ">刪除</view>
         </view>
         </view>
        </view>

        css:

        .container {
         padding: 0;
        }
         
        page {
         padding: 0;
        }
         
        .main {
         display: flex;
         flex-direction: column;
         align-items: center;
        }
         
        .main_item {
         display: flex;
         flex-direction: row;
         background: #fff;
         overflow: hidden;
        }
         
        movable-area {
         width: 532rpx;
         height: 201rpx;
         background: #fff;
        }
         
        movable-view {
         width: 716rpx;
         height: 201rpx;
        }
         
        .main_item_content {
         box-sizing: border-box;
         height: 201rpx;
         border-radius: 10rpx;
         line-height: 201rpx;
         color: #8e8e8e;
         padding-left: 10px;
         background: #eee;
        }
         
        .delete_btn {
         width: 184rpx;
         height: 201rpx;
         background-color: #8FC31F;
         border-top-right-radius: 10px;
         border-bottom-right-radius: 10px;
         color: #fff;
         font-size: 28rpx;
         text-align: center;
         line-height: 201rpx;
        }

        js:

        // pages/listDel/index.js
        Page({
         
         /**
         * 頁面的初始數據
         */
         data: {
         // x軸方向的偏移
         x: 0,
         // 當前x的值
         currentX: 0
         },
         
         handleMovableChange: function(e) {
         // this.data.currentX = e.detail.x;
         this.data.currentX = e.detail.x;
         },
         
         handleTouchend: function(e) {
         this.isMove = true;
         if (this.data.currentX < -46) {
         this.data.x = -92;
         this.setData({
         x: this.data.x
         });
         } else {
         this.data.x = 0;
         this.setData({
         x: this.data.x
         });
         }
         },
         handleTouchestart: function(e) {},
         /**
         * 生命周期函數--監聽頁面加載
         */
         onLoad: function(options) {
         // let _this = this;
         // wx.createSelectorQuery().selectAll('.delBtn ').boundingClientRect(function(rect) {
         // _this.data.delWidth = rect[0].width;
         // }).exec();
         },
         
         /**
         * 生命周期函數--監聽頁面初次渲染完成
         */
         onReady: function() {
         
         },
         
         /**
         * 生命周期函數--監聽頁面顯示
         */
         onShow: function() {
         
         },
         
         /**
         * 生命周期函數--監聽頁面隱藏
         */
         onHide: function() {
         
         },
         
         /**
         * 生命周期函數--監聽頁面卸載
         */
         onUnload: function() {
         
         },
         
         /**
         * 頁面相關事件處理函數--監聽用戶下拉動作
         */
         onPullDownRefresh: function() {
         
         },
         
         /**
         * 頁面上拉觸底事件的處理函數
         */
         onReachBottom: function() {
         
         },
         
         /**
         * 用戶點擊右上角分享
         */
         onShareAppMessage: function() {
         
         }
        })

        2:touchstart、touchmove 如果大家想了解的更清楚可以查看幫助文檔的哦

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

        文檔

        小程序實現左滑刪除效果

        代碼如下:html;<;view class="container">;<;view class="main">;<;view class="main_item">;<;movable-area>;<;movable-view damping="100" out-of-bounds="true" direction="horizontal" x="{{x}}" animation="false" bindchange="handleMovableChange" capture-bind:touchstart="handleTouchestart" capture-bind:touchend="handleTouchend">;<。
        推薦度:
        標簽: 小程序 實現 效果
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 国产精品亚洲va在线观看| 亚洲一区二区三区在线| 国产成人亚洲精品播放器下载| 免费在线看v网址| 亚洲人成网站在线观看播放青青| 久久久精品免费视频| 久久91亚洲精品中文字幕| 久久午夜夜伦鲁鲁片无码免费| 亚洲国产a∨无码中文777| 久久国产乱子精品免费女| 国产成A人亚洲精V品无码性色| 高清一区二区三区免费视频| 亚洲黄色三级视频| 成年女人毛片免费视频| 在线观看亚洲AV日韩A∨| 国产无遮挡裸体免费视频| 特色特黄a毛片高清免费观看| 国产亚洲?V无码?V男人的天堂| 你是我的城池营垒免费观看完整版| 亚洲成a人片在线观看无码专区| 久久免费观看国产精品| 亚洲毛片免费观看| 精品国产免费一区二区| 91av免费在线视频| 亚洲激情黄色小说| 四虎影视免费永久在线观看| 丰满人妻一区二区三区免费视频| 亚洲AV无码专区国产乱码电影 | 国产亚洲av片在线观看18女人| 两个人日本免费完整版在线观看1| 亚洲人成网www| 妞干网免费视频观看| 大片免费观看92在线视频线视频| 亚洲av无码国产精品夜色午夜| 成人免费AA片在线观看| 男女猛烈无遮掩视频免费软件| 亚洲av日韩av无码| 日日夜夜精品免费视频| 成人爽a毛片免费| 亚洲精品无码成人| 久久亚洲精品AB无码播放|