diff --git a/src/client/components/form/radios.vue b/src/client/components/form/radios.vue index 4cfb7c247..b660c37ac 100644 --- a/src/client/components/form/radios.vue +++ b/src/client/components/form/radios.vue @@ -27,7 +27,10 @@ export default defineComponent({ }, render() { const label = this.$slots.desc(); - const options = this.$slots.default(); + let options = this.$slots.default(); + + // なぜかFragmentになることがあるため + if (options.length === 1 && options[0].props == null) options = options[0].children; return h('div', { class: 'cnklmpwm _formItem' @@ -37,7 +40,7 @@ export default defineComponent({ }, label), ...options.map(option => h('button', { class: '_button _formPanel _formClickable', - key: option.props.value, + key: option.key, onClick: () => this.value = option.props.value, }, [h('span', { class: ['check', { checked: this.value === option.props.value }], diff --git a/src/client/components/tab.vue b/src/client/components/tab.vue index 5e54fc968..3902b7f98 100644 --- a/src/client/components/tab.vue +++ b/src/client/components/tab.vue @@ -14,7 +14,7 @@ export default defineComponent({ class: 'pxhvhrfw', }, options.map(option => withDirectives(h('button', { class: ['_button', { active: this.value === option.props.value }], - key: option.props.value, + key: option.key, disabled: this.value === option.props.value, onClick: () => { this.$emit('update:value', option.props.value); diff --git a/src/client/components/ui/radios.vue b/src/client/components/ui/radios.vue index 547e616ea..8a62b8768 100644 --- a/src/client/components/ui/radios.vue +++ b/src/client/components/ui/radios.vue @@ -23,14 +23,17 @@ export default defineComponent({ }, render() { const label = this.$slots.desc(); - const options = this.$slots.default(); + let options = this.$slots.default(); + + // なぜかFragmentになることがあるため + if (options.length === 1 && options[0].props == null) options = options[0].children; return h('div', { class: 'novjtcto' }, [ h('div', label), ...options.map(option => h(MkRadio, { - key: option.props.value, + key: option.key, value: option.props.value, modelValue: this.value, 'onUpdate:modelValue': value => this.value = value,