From 69d9aa71f25ab06d8024b04ce341909425d053d6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 9 Aug 2020 15:51:02 +0900 Subject: Full view mode (#6636) * wuip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update folder.vue * wip * Update size.ts * wip * wip * Update index.vue * wip --- src/client/widgets/define.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/client/widgets') diff --git a/src/client/widgets/define.ts b/src/client/widgets/define.ts index 107045bf4b..50c9b10e81 100644 --- a/src/client/widgets/define.ts +++ b/src/client/widgets/define.ts @@ -8,7 +8,8 @@ export default function (data: { return Vue.extend({ props: { widget: { - type: Object + type: Object, + required: false }, isCustomizeMode: { type: Boolean, @@ -16,19 +17,13 @@ export default function (data: { } }, - data() { - return { - bakedOldProps: null - }; - }, - computed: { id(): string { - return this.widget.id; + return this.widget ? this.widget.id : null; }, props(): Record { - return this.widget.data; + return this.widget ? this.widget.data : {}; } }, @@ -67,7 +62,9 @@ export default function (data: { }, save() { - this.$store.commit('deviceUser/updateWidget', this.widget); + if (this.widget) { + this.$store.commit('deviceUser/updateWidget', this.widget); + } } } }); -- cgit v1.2.3-freya