diff options
author | dartcafe <github@dartcafe.de> | 2021-06-25 17:42:34 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2021-06-25 17:42:34 +0300 |
commit | 75a1d566062518e5bbb8d2d1191d92b1e757c5bf (patch) | |
tree | 98759f18a85de655b372b751ee88c0ef6e4eeb1b /src/js | |
parent | dd5e6f67f9e17d1e8e1e7e17764f1de7f92b9ab3 (diff) |
Replace radio buttons with CheckboxRadioSwitch from @nextcloud/vue
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/components/Base/RadioGroupDiv.vue | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/js/components/Base/RadioGroupDiv.vue b/src/js/components/Base/RadioGroupDiv.vue index d158d14a..b70920cf 100644 --- a/src/js/components/Base/RadioGroupDiv.vue +++ b/src/js/components/Base/RadioGroupDiv.vue @@ -22,26 +22,29 @@ <template lang="html"> <div class="radio-group-div"> - <fieldset v-for="(option, index) in options" :key="option.value"> - <input :id="id + '_' + index" - :checked="option.value === value" - :value="option.value" - type="radio" - class="radio" - @change="$emit('input', option.value)"> - <label :for="id + '_' + index"> - <slot name="before" /> - {{ option.label }} - </label> - </fieldset> + <CheckboxRadioSwitch v-for="(option, index) in options" + :key="option.value" + :name="id + '_' + index" + :checked="option.value === value" + type="radio" + @update:checked="$emit('input', option.value)"> + {{ option.label }} + </CheckboxRadioSwitch> </div> </template> <script> +import { CheckboxRadioSwitch } from '@nextcloud/vue' + const RandId = () => Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10) export default { name: 'RadioGroupDiv', + + components: { + CheckboxRadioSwitch, + }, + props: { id: { type: String, |