# 窗口拖动

# el-dialog 方案

  • 使用v-dialogDrag指令,配合el-dialog实现
  • 可以用于快速替换原有方案

<template>
  <section class="ElDialogDragDemo">
    <el-button @click="elDialog = true">el窗口</el-button>
    <el-dialog v-dialogDrag title="el窗口" :visible.sync="elDialog">
      el窗口
    </el-dialog>
  </section>
</template>

<script>
export default {
  name: 'ElDialogDragDemo',
  data() {
    return {
      elDialog: false,
    }
  },
}
</script>


Expand Copy

# vxe-modal 方案

vxe窗口-带拖拽调整、全屏功能

<template>
  <section class="VxeDialogDragDemo">
    <el-button @click="vxeDialog = true">vxe窗口</el-button>
    <vxe-modal v-model="vxeDialog" show-zoom resize width="50%" height="50%">
      vxe窗口-带拖拽调整、全屏功能
    </vxe-modal>
  </section>
</template>

<script>
export default {
  name: 'VxeDialogDragDemo',
  data() {
    return {
      vxeDialog: false,
    }
  },
}
</script>

Expand Copy
Last Updated: 4/17/2023, 4:44:58 PM