diff --git a/src/components/CustomComponent.vue b/src/components/CustomComponent.vue index 390de7b..cce20aa 100644 --- a/src/components/CustomComponent.vue +++ b/src/components/CustomComponent.vue @@ -1,6 +1,6 @@ diff --git a/src/components/FormBuilder.vue b/src/components/FormBuilder.vue index 0e66465..fb7bb6d 100644 --- a/src/components/FormBuilder.vue +++ b/src/components/FormBuilder.vue @@ -201,17 +201,16 @@ export default { return name }, setValue(name, value, lang) { - // console.log('setValue', name, value, lang, this.isSubForm) + if (!this.fields[name].multilingual) { - return this.$set(this.model, name, value); - // return _.set(this.model, name, value); - } - if (lang && !_.isObject(this.model[name])) { - this.$set(this.model, name, {}); + // return this.$set(this.model, name, value); + _.set(this.model, name, value); + } else if (lang && !_.isObject(this.model[name])) { + _.set(this.model, name, {}); + } else { + _.set(this.model[name], lang, value); } - this.$set(this.model[name], lang, value); - // _.set(this.model, key, value); - // console.log(key, value) + return this.$emit('input', this.model) }, titlize() {}, isShowField(field) { @@ -275,10 +274,6 @@ export default { mounted() { this.model = this.value; - this.$watch('model', val => { - this.$emit('input', val) - }, {deep: true}) - for (let [k, v] of Object.entries(this.fields)) { if (v.type === "object" && !this.model[k]) { this.$set(this.model, k, {}); diff --git a/src/views/CustomPage.vue b/src/views/CustomPage.vue index 362e99e..c83ef1a 100644 --- a/src/views/CustomPage.vue +++ b/src/views/CustomPage.vue @@ -36,7 +36,7 @@ export default { render() {}, async fetchPage() { this.$http.get(this.uri).then(({ data }) => { - data.name = "custom-page-" + new Date().getTime().toString(); + data.name = "server-page-" + new Date().getTime().toString(); this.page = Object.assign({}, data) }); },