Skip to content

Commit 164e37e

Browse files
committed
fix(api): setting switch clickable on whole item
1 parent bfe481c commit 164e37e

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

packages/app-frontend/src/features/plugin/PluginSettingsItem.vue

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export default defineComponent({
3434
})
3535
3636
function onLabelClick () {
37-
// @TODO
37+
if (props.schema.type === 'boolean') {
38+
model.value = !model.value
39+
}
3840
}
3941
4042
return {
@@ -46,11 +48,11 @@ export default defineComponent({
4648
</script>
4749

4850
<template>
49-
<div class="flex items-start px-6 py-2 hover:bg-green-50 dark:hover:bg-green-900">
50-
<div
51-
class="flex-1 select-none text-sm py-1.5"
52-
@click="onLabelClick()"
53-
>
51+
<div
52+
class="flex items-start px-6 py-2 hover:bg-green-50 dark:hover:bg-green-900"
53+
@click="onLabelClick()"
54+
>
55+
<div class="flex-1 select-none text-sm py-1.5">
5456
<div>{{ schema.label }}</div>
5557
<div
5658
v-if="schema.description"
@@ -60,11 +62,16 @@ export default defineComponent({
6062
</div>
6163
</div>
6264
<div class="w-1/2">
63-
<VueSwitch
65+
<div
6466
v-if="schema.type === 'boolean'"
65-
v-model="model"
66-
class="my-2 w-full extend-left"
67-
/>
67+
class="my-2 w-full h-[max-content]"
68+
@click.stop
69+
>
70+
<VueSwitch
71+
v-model="model"
72+
class="w-full extend-left"
73+
/>
74+
</div>
6875

6976
<template v-else-if="schema.type === 'choice'">
7077
<VueGroup

0 commit comments

Comments
 (0)