DialogDrag 窗口拖拽

... 2022-5-10 Less than 1 minute

# DialogDrag 窗口拖拽

avue-dialog同时添加v-dialogDrag指令即可拖动

<el-dialog title="提示"
           v-dialogDrag
           :visible.sync="type0"
            width="40%">
  <span>这是一段信息</span>
  <span slot="footer">
    <el-button @click="type0=false" >取 消</el-button>
    <el-button @click="type0=false" type="primary">确 定</el-button>
  </span>
</el-dialog>
<el-dialog title="提示"
            v-dialogDrag
           :visible.sync="type1"
            class="avue-dialog avue-dialog--top"
            width="40%">
    <span>这是一段信息</span>
    <div class="avue-dialog__footer">
      <el-button @click="type1=false">取 消</el-button>
      <el-button @click="type1=false" type="primary">确 定</el-button>
    </div>
</el-dialog>
<el-button @click="openBox(0)">原生el样式弹窗</el-button>
<el-button type="primary"
            @click="openBox(1)">avue样式弹窗</el-button>

<script>
export default {
  data () {
    return {
      type0: false,
      type1:false
    }
  },
  methods: {
    openBox (index) {
      this['type'+index] = true;
    }
  }
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Expand Copy
Last update: May 10, 2022 10:37
Contributors: smallwei
您正在浏览基于 Vue 2.x 的 Avue 文档; 点击这里 查看 Vue 3.x 的升级版本