refactor components

This commit is contained in:
syuilo 2021-09-30 00:50:45 +09:00
parent 0d3a36e519
commit 1ac1a968b9
179 changed files with 2611 additions and 2386 deletions

View file

@ -32,7 +32,7 @@ export default defineComponent({
},
props: {
value: {
modelValue: {
type: Array,
required: true
},
@ -41,15 +41,15 @@ export default defineComponent({
},
},
emits: ['update:value'],
emits: ['update:modelValue'],
computed: {
blocks: {
get() {
return this.value;
return this.modelValue;
},
set(value) {
this.$emit('update:value', value);
this.$emit('update:modelValue', value);
}
}
},
@ -62,17 +62,16 @@ export default defineComponent({
v,
...this.blocks.slice(i + 1)
];
this.$emit('update:value', newValue);
this.$emit('update:modelValue', newValue);
},
removeItem(el) {
console.log(el);
const i = this.blocks.findIndex(x => x.id === el.id);
const newValue = [
...this.blocks.slice(0, i),
...this.blocks.slice(i + 1)
];
this.$emit('update:value', newValue);
this.$emit('update:modelValue', newValue);
},
}
});