element el-dialog弹窗拖动
时间: 2023-07-31 17:14:02 浏览: 139
基于element-ui对话框el-dialog初始化的校验问题解决
5星 · 资源好评率100%
element el-dialog弹窗可以通过添加指令v-dialogDrag来实现拖动功能。在使用el-dialog标签时,可以添加v-dialogDrag指令,这样当鼠标触摸对话框顶部时就会出现拖动的鼠标样式,按住鼠标就可以拖动对话框到窗口任意位置了。例如,在el-dialog标签中添加v-dialogDrag指令的示例代码如下:
```html
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" width="500px" title="请选择" :close-on-click-modal="false" v-dialogDrag>
</el-dialog>
```
这样就可以实现element el-dialog弹窗的拖动功能了。
#### 引用[.reference_title]
- *1* *3* [Vue中使用element-ui el-dialog弹窗最大化还原,拖拽,动态改变大小](https://blog.csdn.net/yf18040578780/article/details/128493811)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [vue el-dialog 弹窗实现拖拽效果](https://blog.csdn.net/weixin_43316300/article/details/110383831)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文