From a51395e2fc25d9e719c1fd2fd04a30eda153a152 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 26 Nov 2019 22:21:42 +0000 Subject: [PATCH] --- .../src/components/custom-fields-control.vue | 30 ++++--------------- ayanova/src/views/inventory-widget-edit.vue | 2 +- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index bd128580..b970d91b 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -175,26 +175,13 @@ CUSTOM FIELD DATA: */ export default { data() { - return { - // c1: null, - // // c2: null, this was replaced with a computed property as will all others - // c3: null, - // c4: null, - // c5: null, - // c6: null, - // c7: null, - // c8: null, - // c9: null, - // c10: null, - // c12: null, - // c13: null, - // c14: null, - // c15: null, - // c16: null - }; + return {}; }, props: { - value: String, + value: { + default: "{}", + type: String + }, formKey: String, //used to grab template from store readOnly: Boolean, parentVM: Object @@ -236,13 +223,6 @@ export default { return cData[dataKey]; }, SetValueForField: function(dataKey, newValue) { - //https://stackoverflow.com/questions/39868963/vue-2-mutating-props-vue-warn - - //Is this a new or empty custom fields object? - if (this.value === null || this.value === undefined) { - this.value = "{}"; //empty json fragment, field will be added later below - } - //Get the current data out of the json string value // var cData = JSON.parse(this.value); diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index d4ea827e..f7fe4386 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -332,7 +332,7 @@ export default { endDate: null, notes: null, count: null, - customFields: null, + customFields: "{}", tags: [] }, formState: {