一、新增一个dialog.js文件
import Vue from 'vue'
// v-dialogDrag: 弹窗拖拽
Vue.directive('dialogDrag', {
bind(el, binding, vnode, oldVnode) {
const dialogHeaderEl = el.querySelector('.el-dialog__header')
const dragDom = el.querySelector('.el-dialog')
dialogHeaderEl.style.cursor = 'move'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
dialogHeaderEl.

本文档介绍了如何通过创建dialog.js文件,并在main.js中引入,以及在el-dialog组件上添加指令,来实现Element UI的弹窗Dialog的动态效果。
最低0.47元/天 解锁文章
1648

被折叠的 条评论
为什么被折叠?



