修复modal标题属性首次如果没有值,再赋值的话就会没用
This commit is contained in:
parent
ab249f7059
commit
f024ab823a
2 changed files with 11 additions and 3 deletions
|
@ -1,12 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
<Button type="primary" @click="modal1 = true">显示对话框</Button>
|
||||
|
||||
<Modal
|
||||
v-model="modal1"
|
||||
title="普通的Modal对话框标题"
|
||||
:title="title"
|
||||
@on-ok="ok"
|
||||
:mask-closable="false"
|
||||
@on-cancel="cancel">
|
||||
<p>对话框内容</p>
|
||||
<p><Button type="ghost" @click="title = '这是标题'">设置标题</Button> {{title}}</p>
|
||||
<p>对话框内容</p>
|
||||
<p>对话框内容</p>
|
||||
</Modal>
|
||||
|
@ -16,7 +18,8 @@
|
|||
export default {
|
||||
data () {
|
||||
return {
|
||||
modal1: false
|
||||
modal1: true,
|
||||
title:''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -261,6 +261,11 @@
|
|||
} else {
|
||||
this.removeScrollEffect();
|
||||
}
|
||||
},
|
||||
title (val) {
|
||||
if (this.$slots.header === undefined) {
|
||||
this.showHead = val?true:false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue