Skip to content

Commit

Permalink
fix: simplify checkbox input handling in App.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail9k committed Dec 17, 2024
1 parent 9a2b812 commit 6a254cc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,17 @@ const handelButtonClick = () => {
</option>
</select>

<input
v-else-if="field.type === 'checkbox'"
:checked="getConfigValue(field.path)"
@input="(e) => setConfigValue(field.path, e.target.checked)"
:type="field.type"
v-bind="field.attrs || {}"
/>
<input
v-else
:value="getConfigValue(field.path)"
@input="
(e) =>
setConfigValue(
field.path,
field.type === 'checkbox' ? e.target.checked : e.target.value
)
"
@input="(e) => setConfigValue(field.path, e.target.value)"
:type="field.type"
v-bind="field.attrs || {}"
/>
Expand Down

0 comments on commit 6a254cc

Please sign in to comment.