优化icon属性设置
parent
045bc6c6be
commit
d80b077197
|
@ -268,7 +268,6 @@ export default class Select {
|
||||||
this.__OUTER__ = this.root.children[1]
|
this.__OUTER__ = this.root.children[1]
|
||||||
this.__PREPEND__ = this.__OUTER__.children[0]
|
this.__PREPEND__ = this.__OUTER__.children[0]
|
||||||
this.__INPUT__ = this.__OUTER__.children[1]
|
this.__INPUT__ = this.__OUTER__.children[1]
|
||||||
this.__ICO__ = this.__OUTER__.children[2]
|
|
||||||
this.__APPEND__ = this.__OUTER__.children[3]
|
this.__APPEND__ = this.__OUTER__.children[3]
|
||||||
this.__OPTG__ = this.__OUTER__.children[4]
|
this.__OPTG__ = this.__OUTER__.children[4]
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,21 +121,13 @@ export default class Icon {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get is() {
|
|
||||||
return this.props.is
|
|
||||||
}
|
|
||||||
|
|
||||||
set is(val) {
|
|
||||||
this.props.is = val
|
|
||||||
this.setAttribute('is', val)
|
|
||||||
this.drawPath()
|
|
||||||
}
|
|
||||||
|
|
||||||
watch() {
|
watch() {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'is':
|
case 'is':
|
||||||
this.is = val
|
if (val) {
|
||||||
if (!val) {
|
this.props.is = val
|
||||||
|
this.drawPath()
|
||||||
|
} else {
|
||||||
this.removeAttribute('is')
|
this.removeAttribute('is')
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
|
@ -339,7 +339,7 @@ class Layer {
|
||||||
case 'frame':
|
case 'frame':
|
||||||
if (val === 'notify') {
|
if (val === 'notify') {
|
||||||
var _ico = document.createElement('wc-icon')
|
var _ico = document.createElement('wc-icon')
|
||||||
_ico.is = 'close'
|
_ico.setAttribute('is', 'close')
|
||||||
this.__TITLE__.appendChild(_ico)
|
this.__TITLE__.appendChild(_ico)
|
||||||
}
|
}
|
||||||
btns = []
|
btns = []
|
||||||
|
|
Reference in New Issue