Skip to content

Commit

Permalink
添加对disabled的支持
Browse files Browse the repository at this point in the history
添加对disabled的支持
  • Loading branch information
zhuxianguo authored and ZakaryCode committed Sep 22, 2020
1 parent 3204583 commit 3c15443
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/taro-components/src/components/switch/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class Switch implements ComponentInterface {
@Prop() checked = false
@Prop() color = '#04BE02'
@Prop() name: string
@Prop() disabled = false
@State() isChecked: boolean

@Element() el: HTMLElement
Expand Down Expand Up @@ -49,7 +50,8 @@ export class Switch implements ComponentInterface {
type,
color,
isChecked,
name
name,
disabled
} = this

const style = isChecked
Expand All @@ -66,6 +68,7 @@ export class Switch implements ComponentInterface {
style={style}
checked={isChecked}
name={name}
disabled={disabled}
onChange={this.switchChange}
/>
)
Expand Down

0 comments on commit 3c15443

Please sign in to comment.