diff --git a/src/drawer/index.js b/src/drawer/index.js index e63114e..d1783bb 100644 --- a/src/drawer/index.js +++ b/src/drawer/index.js @@ -48,7 +48,7 @@ class Drawer extends Component { }, width: '', height: '', - 'mask-close': false + maskClose: false } static styles = [ @@ -136,7 +136,7 @@ class Drawer extends Component { this.$on('click', ev => { let path = ev.composedPath() - if (path[0] === ev.currentTarget && this['mask-close']) { + if (path[0] === ev.currentTarget && this.maskClose) { this.closeDrawer() } }) diff --git a/src/form/star.js b/src/form/star.js index 725e195..29c9889 100644 --- a/src/form/star.js +++ b/src/form/star.js @@ -11,8 +11,8 @@ class Star extends Component { static props = { value: 0, text: [], - 'allow-half': false, - 'show-value': false, + allowHalf: false, + showValue: false, disabled: false, clearable: false } @@ -115,7 +115,7 @@ class Star extends Component { f = f < 0.5 ? 0.5 : 1 } - if (!this['allow-half']) { + if (!this.allowHalf) { f = f > 0 ? 1 : 0 } // 数值没变化, 直接终止 @@ -199,7 +199,7 @@ class Star extends Component { - ${this['show-value'] ? val : ''} + ${this.showValue ? val : ''} ` } diff --git a/src/form/switch.js b/src/form/switch.js index b140f32..1ef568d 100644 --- a/src/form/switch.js +++ b/src/form/switch.js @@ -14,9 +14,9 @@ class Switch extends Component { default: false, attribute: false }, - 'inactive-text': '', - 'active-text': '', - 'inline-text': false, + inactiveText: '', + activeText: '', + inlineText: false, disabled: false, readonly: false } @@ -215,17 +215,17 @@ class Switch extends Component { > ${!this['inline-text'] + >${!this.inlineText ? this.value - ? this['active-text'] - : this['inactive-text'] + ? this.activeText + : this.inactiveText : ''} ` diff --git a/src/layer/index.js b/src/layer/index.js index 2bf54ba..3911766 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -32,9 +32,9 @@ class Layer extends Component { top: { type: String, attribute: false }, bottom: { type: String, attribute: false }, background: { type: String, attribute: false }, - 'mask-color': { type: String, attribute: false }, + maskColor: { type: String, attribute: false }, mask: false, - 'mask-close': false, + maskClose: false, title: { type: String, default: '', attribute: false }, content: { type: String, default: '', attribute: false }, btns: [] @@ -356,7 +356,7 @@ class Layer extends Component { return } - if (this['mask-close']) { + if (this.maskClose) { if (this.#wrapped === false) { this.#reject() } @@ -365,8 +365,8 @@ class Layer extends Component { } }) - if (this['mask-color']) { - this.style.backgroundColor = this['mask-color'] + if (this.maskColor) { + this.style.backgroundColor = this.maskColor } } diff --git a/src/tabs/index.js b/src/tabs/index.js index 5feabba..6b1059b 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -19,7 +19,7 @@ class Tabs extends Component { static props = { tab: { type: String, attribute: false }, type: 'default', - 'tab-position': 'top', + tabPosition: 'top', labels: [] } @@ -526,7 +526,7 @@ class Tabs extends Component { render() { let tabStyle = {} - if (this['tab-position'] === 'top' || this['tab-position'] === 'bottom') { + if (this.tabPosition === 'top' || this.tabPosition === 'bottom') { tabStyle = { width: this.#tabWidth + 'px', left: this.#tabLeft + 'px'