refactor components
This commit is contained in:
@@ -3,7 +3,7 @@ import { defineComponent, h, resolveDirective, withDirectives } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
value: {
|
||||
modelValue: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
@@ -13,11 +13,11 @@ export default defineComponent({
|
||||
return withDirectives(h('div', {
|
||||
class: 'pxhvhrfw',
|
||||
}, options.map(option => withDirectives(h('button', {
|
||||
class: ['_button', { active: this.value === option.props.value }],
|
||||
class: ['_button', { active: this.modelValue === option.props.modelValue }],
|
||||
key: option.key,
|
||||
disabled: this.value === option.props.value,
|
||||
disabled: this.modelValue === option.props.modelValue,
|
||||
onClick: () => {
|
||||
this.$emit('update:value', option.props.value);
|
||||
this.$emit('update:modelValue', option.props.modelValue);
|
||||
}
|
||||
}, option.children), [
|
||||
[resolveDirective('click-anime')]
|
||||
|
Reference in New Issue
Block a user