element-plus 提供的 el-dialog 对话框功能非常强大,只是美中不足不能通过拖拽的方式改变位置,有点小遗憾,那么怎么办呢?我们可以通过 vue 的自定义指令来实现一个可以拖拽的对话框(el-dialog)。 拖拽演示 https://www.zhihu.com ...
在vue的utils中新建一个dialogDrag.js .在main.js中引用 import utils dialogDrag.js 。使用v dialogDrag指令 .你可能遇到这样的问题,我只要在弹出层中滚动后,就无法缩放,或者我想让确定和取消按钮始终在底部显示 那么你需要设置css ...
2021-04-13 23:55 0 800 推荐指数:
element-plus 提供的 el-dialog 对话框功能非常强大,只是美中不足不能通过拖拽的方式改变位置,有点小遗憾,那么怎么办呢?我们可以通过 vue 的自定义指令来实现一个可以拖拽的对话框(el-dialog)。 拖拽演示 https://www.zhihu.com ...
<style scoped> /deep/ .el-dialog { height: 78vh; overflow: auto; } ...
<style scoped> /deep/ .el-dialog { height: 78vh; overflow: auto; } </style> ...
非常简单,在子dilog中 加入 即可 ...
1、在 utils 中新建 directives.js 文件 import Vue from 'vue' // v-dialogDrag: 弹窗拖拽 Vue.directive('dialogDrag', { bind(el, binding, vnode, oldVnode ...
Vue.directive('dialogDrag', { inserted:function(el) { const dragDom = el.querySelector('.jsPropupLayerHead ...
template :append-to-body="true" data methods close-on-click-modal:是否可以通过点击 modal 关闭 Dialog 默认值为true 更多 ...
参考:实现在vue中element-ui的el-dialog弹框拖拽 1、在 utils 中新建 directives.js 文件 2、main.js中导入:import ‘./utils/directives.js’3、使用 el-dialog 的地方加入 ...