css3 模态框从底部弹出

在这里插入图片描述
1.vue

<!--弹出框-->
<div class="popup">
	<div class="mask" v-show="shareType"></div>
	<div class="share" :style="{bottom: num + 'px'}">
		<div class="share-opt bg-color"></div>
		<div class="btn bg-color" @click="cancel">取消</div>
	</div>
</div>

2.css

/*弹出框*/
	.mask{position: fixed;top: 0;left: 0;height: 100%;width: 100%;background: rgba(0,0,0,0.5);z-index: 99;}
	.share{width: calc(100% - 20px);height: 273px;position: fixed;left: 10px;z-index: 100;transition: bottom .5s ease-in;}
	.share .share-opt{width: 100%;height: 210px;border-radius: 8px;}
	.share .btn{width: 100%;height: 40px;line-height: 40px;text-align: center;border-radius: 20px;color: #333333;font-size: 14px;border: none;margin-top: 10px;}

3 .js

export default{
		name: 'mine',
		data() {
			return{
				shareType:false,
		     	num: -273
			}
		},
		methods: {
			share: function() {
				this.shareType = true;
				this.num = 0
			},
			cancel: function() {
				this.num = -273;
				setTimeout(()=>{this.shareType = false;},600)
			}
		}
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值