Skip to content

Commit

Permalink
fix(Toggle): missing disabled prop
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jun 12, 2023
1 parent be5f352 commit fe833eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/content/3.forms/7.toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ excludedProps:
---
::

### Disabled

Use the `disabled` prop to disable the Toggle.

::component-card
---
props:
disabled: true
---
::


## Props

:component-props
Expand Down
5 changes: 5 additions & 0 deletions src/runtime/components/forms/Toggle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Switch
v-model="active"
:name="name"
:disabled="disabled"
:class="[active ? ui.active : ui.inactive, ui.base]"
>
<span :class="[active ? ui.container.active : ui.container.inactive, ui.container.base]">
Expand Down Expand Up @@ -43,6 +44,10 @@ export default defineComponent({
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
onIcon: {
type: String,
default: () => appConfig.ui.toggle.default.onIcon
Expand Down

0 comments on commit fe833eb

Please sign in to comment.