zoukankan      html  css  js  c++  java
  • mpvue小程序 上拉菜单

    template

    <view class="drawer_screen" v-if="updateTel"></view> //遮罩层
    <view :animation="animationData" class="drawer_attr_box" v-if="updateTel"> 
    <view class="drawer_content">
    //里面可以放你想要的一些东西
    </view>
    </view>
     
    script
     
    //放一些点击显示的效果
    util(currentStatu) {
    /* 动画部分 */
    // 第1步:创建动画实例
    var animation = wx.createAnimation({
    duration: 200, //动画时长
    timingFunction: "linear", //线性
    delay: 0 //0则不延迟
    });
    // 第2步:这个动画实例赋给当前的动画实例
    this.animation = animation;
    // 第3步:执行第一组动画:Y轴偏移240px后(盒子高度是240px),停
    animation.translateY(240).step();
    // 第4步:导出动画对象赋给数据对象储存
    this.animationData = animation.export();
    // 第5步:设置定时器到指定时候后,执行第二组动画
    setTimeout(
    function() {
    // 执行第二组动画:Y轴不偏移,停
    animation.translateY(0).step();
    // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
    this.animationData = animation;
    }.bind(this),
    200
    );
    // 显示抽屉
    if (currentStatu == "address_open") {
    this.addAddress = true;
    }
    if (currentStatu == "update_open") {
    this.updateAddresss = true;
    }
    }
     
    style
    //样式
     
    .drawer_screen {
    100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: #000;
    opacity: 0.2;
    overflow: hidden;
    }

    /*content*/
    .drawer_attr_box {
    100%;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1001;
    background: #fff;
    }
    .drawer_content {
    padding: 20rpx 40rpx;
    height: 470rpx;
    overflow-y: scroll;
    }
     
    这是目前对于我来说还算差不多满意的一个,推荐给大家!!!
  • 相关阅读:
    git stash错误小记
    PHP,Mysql根据经纬度计算距离并排序
    JS~字符串长度判断,超出进行自动截取(支持中文)
    Redis的三种启动方式
    Ubuntu 14.04 LTS下安装Google Chrome浏览器
    PHP-PHPExcel用法详解
    git设置log的别名 for hist log样式格式化
    Ubuntu系统下配置PHP支持SQLServer 2005
    Git命令图片版
    《一线架构师实践指南》读后感(二)
  • 原文地址:https://www.cnblogs.com/mcll/p/10858000.html
Copyright © 2011-2022 走看看