Skip to content

Commit

Permalink
fix(api): setting switch clickable on whole item
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 10, 2022
1 parent bfe481c commit 164e37e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions packages/app-frontend/src/features/plugin/PluginSettingsItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export default defineComponent({
})
function onLabelClick () {
// @TODO
if (props.schema.type === 'boolean') {
model.value = !model.value
}
}
return {
Expand All @@ -46,11 +48,11 @@ export default defineComponent({
</script>

<template>
<div class="flex items-start px-6 py-2 hover:bg-green-50 dark:hover:bg-green-900">
<div
class="flex-1 select-none text-sm py-1.5"
@click="onLabelClick()"
>
<div
class="flex items-start px-6 py-2 hover:bg-green-50 dark:hover:bg-green-900"
@click="onLabelClick()"
>
<div class="flex-1 select-none text-sm py-1.5">
<div>{{ schema.label }}</div>
<div
v-if="schema.description"
Expand All @@ -60,11 +62,16 @@ export default defineComponent({
</div>
</div>
<div class="w-1/2">
<VueSwitch
<div
v-if="schema.type === 'boolean'"
v-model="model"
class="my-2 w-full extend-left"
/>
class="my-2 w-full h-[max-content]"
@click.stop
>
<VueSwitch
v-model="model"
class="w-full extend-left"
/>
</div>

<template v-else-if="schema.type === 'choice'">
<VueGroup
Expand Down

0 comments on commit 164e37e

Please sign in to comment.