mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-19 17:49:41 +08:00
修复 OptionEditor 的初始化和 modelValue 的空值处理
This commit is contained in:
parent
f28e53ea53
commit
acf924dc8b
@ -57,12 +57,13 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
localObject() {
|
localObject() {
|
||||||
return this.modelValue;
|
return this.modelValue || {};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateOption(key, value) {
|
updateOption(key, value) {
|
||||||
this.$emit("update:modelValue", { ...this.localObject, [key]: value });
|
const newValue = { ...this.localObject, [key]: value };
|
||||||
|
this.$emit("update:modelValue", newValue);
|
||||||
},
|
},
|
||||||
getColumnStyle(width = 12) {
|
getColumnStyle(width = 12) {
|
||||||
if (width === "auto") {
|
if (width === "auto") {
|
||||||
@ -82,6 +83,12 @@ export default defineComponent({
|
|||||||
return ["q-input", "q-select"].includes(config.component) && config.icon;
|
return ["q-input", "q-select"].includes(config.component) && config.icon;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
// Initialize with empty object if modelValue is null/undefined
|
||||||
|
if (!this.modelValue) {
|
||||||
|
this.$emit("update:modelValue", {});
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user