From 019b3caea32a1a50388825afc9ef3c5e8cd78cbd Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 5 Mar 2020 15:49:36 -0800 Subject: [PATCH] Make it work with dot notation variable names --- src/components/inspector/loop.vue | 6 ------ src/components/renderer/form-loop.vue | 9 +++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/inspector/loop.vue b/src/components/inspector/loop.vue index 00469b974..6a2cfcca0 100644 --- a/src/components/inspector/loop.vue +++ b/src/components/inspector/loop.vue @@ -74,12 +74,6 @@ export default { }, immediate: true, }, - // 'inspectionConfig.name': { - // handler() { - // this.settings.varname = this.inspectionConfig.name; - // }, - // immediate: true, - // } }, computed: { }, diff --git a/src/components/renderer/form-loop.vue b/src/components/renderer/form-loop.vue index c599e98b4..d83e100ab 100644 --- a/src/components/renderer/form-loop.vue +++ b/src/components/renderer/form-loop.vue @@ -82,11 +82,8 @@ export default { watch: { transientData: { handler() { - if (this.transientData && this.transientData[this.name]) { - this.matrix = this.transientData[this.name]; - } else { - this.matrix = []; - } + const data = _.get(this, 'transientData.' + this.name, null); + this.matrix = data ? data : []; this.setupMatrix(); }, immediate: true, @@ -99,7 +96,7 @@ export default { }, matrix: { handler() { - this.$parent.model[this.name] = this.matrix; + this.$set(this.$parent.model, this.name, this.matrix); }, deep: true, },