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
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 Copy