props定义改为驼峰

master
yutent 2023-05-24 11:54:26 +08:00
parent f86ce323c8
commit 329421995b
5 changed files with 22 additions and 22 deletions

View File

@ -48,7 +48,7 @@ class Drawer extends Component {
}, },
width: '', width: '',
height: '', height: '',
'mask-close': false maskClose: false
} }
static styles = [ static styles = [
@ -136,7 +136,7 @@ class Drawer extends Component {
this.$on('click', ev => { this.$on('click', ev => {
let path = ev.composedPath() let path = ev.composedPath()
if (path[0] === ev.currentTarget && this['mask-close']) { if (path[0] === ev.currentTarget && this.maskClose) {
this.closeDrawer() this.closeDrawer()
} }
}) })

View File

@ -11,8 +11,8 @@ class Star extends Component {
static props = { static props = {
value: 0, value: 0,
text: [], text: [],
'allow-half': false, allowHalf: false,
'show-value': false, showValue: false,
disabled: false, disabled: false,
clearable: false clearable: false
} }
@ -115,7 +115,7 @@ class Star extends Component {
f = f < 0.5 ? 0.5 : 1 f = f < 0.5 ? 0.5 : 1
} }
if (!this['allow-half']) { if (!this.allowHalf) {
f = f > 0 ? 1 : 0 f = f > 0 ? 1 : 0
} }
// 数值没变化, 直接终止 // 数值没变化, 直接终止
@ -199,7 +199,7 @@ class Star extends Component {
<wc-icon data-idx="2" name="star"></wc-icon> <wc-icon data-idx="2" name="star"></wc-icon>
<wc-icon data-idx="3" name="star"></wc-icon> <wc-icon data-idx="3" name="star"></wc-icon>
<wc-icon data-idx="4" name="star"></wc-icon> <wc-icon data-idx="4" name="star"></wc-icon>
<span class="text">${this['show-value'] ? val : ''}</span> <span class="text">${this.showValue ? val : ''}</span>
</label> </label>
` `
} }

View File

@ -14,9 +14,9 @@ class Switch extends Component {
default: false, default: false,
attribute: false attribute: false
}, },
'inactive-text': '', inactiveText: '',
'active-text': '', activeText: '',
'inline-text': false, inlineText: false,
disabled: false, disabled: false,
readonly: false readonly: false
} }
@ -215,17 +215,17 @@ class Switch extends Component {
> >
<span <span
class=${classes} class=${classes}
st=${this['inline-text'] st=${this.inlineText
? this.value ? this.value
? this['active-text'] ? this.activeText
: this['inactive-text'] : this.inactiveText
: ''} : ''}
></span> ></span>
<slot <slot
>${!this['inline-text'] >${!this.inlineText
? this.value ? this.value
? this['active-text'] ? this.activeText
: this['inactive-text'] : this.inactiveText
: ''}</slot : ''}</slot
> >
</label>` </label>`

View File

@ -32,9 +32,9 @@ class Layer extends Component {
top: { type: String, attribute: false }, top: { type: String, attribute: false },
bottom: { type: String, attribute: false }, bottom: { type: String, attribute: false },
background: { type: String, attribute: false }, background: { type: String, attribute: false },
'mask-color': { type: String, attribute: false }, maskColor: { type: String, attribute: false },
mask: false, mask: false,
'mask-close': false, maskClose: false,
title: { type: String, default: '', attribute: false }, title: { type: String, default: '', attribute: false },
content: { type: String, default: '', attribute: false }, content: { type: String, default: '', attribute: false },
btns: [] btns: []
@ -356,7 +356,7 @@ class Layer extends Component {
return return
} }
if (this['mask-close']) { if (this.maskClose) {
if (this.#wrapped === false) { if (this.#wrapped === false) {
this.#reject() this.#reject()
} }
@ -365,8 +365,8 @@ class Layer extends Component {
} }
}) })
if (this['mask-color']) { if (this.maskColor) {
this.style.backgroundColor = this['mask-color'] this.style.backgroundColor = this.maskColor
} }
} }

View File

@ -19,7 +19,7 @@ class Tabs extends Component {
static props = { static props = {
tab: { type: String, attribute: false }, tab: { type: String, attribute: false },
type: 'default', type: 'default',
'tab-position': 'top', tabPosition: 'top',
labels: [] labels: []
} }
@ -526,7 +526,7 @@ class Tabs extends Component {
render() { render() {
let tabStyle = {} let tabStyle = {}
if (this['tab-position'] === 'top' || this['tab-position'] === 'bottom') { if (this.tabPosition === 'top' || this.tabPosition === 'bottom') {
tabStyle = { tabStyle = {
width: this.#tabWidth + 'px', width: this.#tabWidth + 'px',
left: this.#tabLeft + 'px' left: this.#tabLeft + 'px'