update $Modal with render
This commit is contained in:
parent
f4273043c2
commit
172e4396df
2 changed files with 56 additions and 54 deletions
|
@ -71,6 +71,32 @@ Modal.newInstance = properties => {
|
|||
]);
|
||||
}
|
||||
|
||||
// when render with no title, hide head
|
||||
let head_render;
|
||||
if (this.title) {
|
||||
head_render = h('div', {
|
||||
attrs: {
|
||||
class: `${prefixCls}-head`
|
||||
}
|
||||
}, [
|
||||
h('div', {
|
||||
class: this.iconTypeCls
|
||||
}, [
|
||||
h('i', {
|
||||
class: this.iconNameCls
|
||||
})
|
||||
]),
|
||||
h('div', {
|
||||
attrs: {
|
||||
class: `${prefixCls}-head-title`
|
||||
},
|
||||
domProps: {
|
||||
innerHTML: this.title
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
return h(Modal, {
|
||||
props: Object.assign({}, _props, {
|
||||
width: this.width,
|
||||
|
@ -91,27 +117,7 @@ Modal.newInstance = properties => {
|
|||
class: prefixCls
|
||||
}
|
||||
}, [
|
||||
h('div', {
|
||||
attrs: {
|
||||
class: `${prefixCls}-head`
|
||||
}
|
||||
}, [
|
||||
h('div', {
|
||||
class: this.iconTypeCls
|
||||
}, [
|
||||
h('i', {
|
||||
class: this.iconNameCls
|
||||
})
|
||||
]),
|
||||
h('div', {
|
||||
attrs: {
|
||||
class: `${prefixCls}-head-title`
|
||||
},
|
||||
domProps: {
|
||||
innerHTML: this.title
|
||||
}
|
||||
})
|
||||
]),
|
||||
head_render,
|
||||
body_render,
|
||||
h('div', {
|
||||
attrs: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue