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;
    }
     
    这是目前对于我来说还算差不多满意的一个,推荐给大家!!!
  • 相关阅读:
    linux安装篇之mongodb安装及服务自启动配置
    Linux下启动mongodb
    java 实现 图片与byte 数组互相转换
    用java imageio调整图片DPI,例如从96调整为300
    StringRedisTemplate操作redis数据
    Docker 更换国内的Hub源
    2、Docker 基础安装和基础使用 一
    Centos 6.x Openssh 升级 7.7p1 版本
    1、Docker 简介
    2. Python环境安装
  • 原文地址:https://www.cnblogs.com/mcll/p/10858000.html
Copyright © 2011-2022 走看看