前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >vue中实现模态框弹出框动画(旋转弹出)

vue中实现模态框弹出框动画(旋转弹出)

作者头像
江咏之
发布2022-06-16 09:23:53
8.9K0
发布2022-06-16 09:23:53
举报
文章被收录于专栏:技术社区技术社区

vue模态框弹窗动画

沃达尔 (Vodal) A Nice vue modal with animations.

带有动画的尼斯vue模态。 安装

代码语言:javascript
复制
npm i -S vodal

用法

代码语言:javascript
复制
<template>
  <div class="home">
    <button @click="togglebox">点击弹出</button>
    <vodal :show="show" animation="rotate" @hide="show = false">
      <div>A vue modal with animations.</div>
    </vodal>
  </div>
</template>

<script>
import Vodal from "vodal";
export default {
  name: "name",
  components: {
    Vodal,
  },
  data() {
    return {
      show: false,
    };
  },
  methods: {
    togglebox: function () {
      this.show = true;
    },
  },
};
</script>
<style lang="scss" scoped>
// include animation styles
@import "../../node_modules/vodal/common.css";
@import "../../node_modules/vodal/rotate.css";
</style>

效果

在这里插入图片描述
在这里插入图片描述

道具 (Props )

Property

Type

Default

Description

width

number

400

width of dialog

height

number

240

height of dialog

measure

string

px

measure of width and height

show

bool

false

whether to show dialog

mask

bool

true

whether to show mask

closeButton

bool

true

whether to show close button

closeOnEsc

bool

false

whether close dialog when esc pressed

closeOnClickMask

bool

true

whether close dialog when mask clicked

animation

string

zoom

animation type

duration

number

300

animation duration

className

string

/

className for the container

customStyles

object

/

custom dialog styles

customMaskStyles

object

/

custom mask styles

属性

类型

默认

描述

宽度

400

对话宽度

高度

240

对话高度

测量

像素

宽度和高度的度量

表演

布尔

是否显示对话框

面具

布尔

真正

是否戴面具

closeButton

布尔

真正

是否显示关闭按钮

closeOnEsc

布尔

按下esc时是否关闭对话框

closeOnClickMask

布尔

真正

单击蒙版时是否关闭对话框

动画

放大

动画类型

持续时间

300

动画时长

班级名称

/

容器的className

customStyles

目的

/

自定义对话框样式

customMaskStyles

目的

/

自定义蒙版样式

事件 (Event)

Name

Description

hide

triggers when dialog will hide

clickMask

triggers when mask clicked

名称

描述

隐藏

对话框隐藏时触发

clickMask

单击蒙版时触发

动画类型 (Animation Types)

  • zoom 放大
  • fade 褪色
  • flip 翻转
  • door 门
  • rotate 旋转
  • slideUp 向上滑动
  • slideDown 滑下
  • slideLeft 向左滑动
  • slideRight 向右滑动
本文参与?腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-03-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客?前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与?腾讯云自媒体同步曝光计划? ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 事件 (Event)
  • 动画类型 (Animation Types)
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
http://www.vxiaotou.com