mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-19 01:09:49 +08:00
修复 OptionEditor 的初始化和 modelValue 的空值处理
This commit is contained in:
parent
f28e53ea53
commit
acf924dc8b
@ -57,12 +57,13 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
localObject() {
|
||||
return this.modelValue;
|
||||
return this.modelValue || {};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
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) {
|
||||
if (width === "auto") {
|
||||
@ -82,6 +83,12 @@ export default defineComponent({
|
||||
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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user