Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wxs77577 committed Oct 24, 2018
1 parent 21e612c commit 0b134b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/CustomComponent.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<component :is="component" ></component>
<component :is="component"></component>
</div>
</template>

Expand Down
21 changes: 8 additions & 13 deletions src/components/FormBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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, {});
Expand Down
2 changes: 1 addition & 1 deletion src/views/CustomPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
},
Expand Down

0 comments on commit 0b134b1

Please sign in to comment.