From 9dd359ef6c3c139ef83ca5061e4d0b8389446761 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 24 Dec 2022 08:38:36 -0600 Subject: [PATCH] Don't set values on ref prop --- src/components/Game.vue | 1 + src/components/Layer.vue | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/Game.vue b/src/components/Game.vue index 4f26260..fd20d25 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -13,6 +13,7 @@ v-if="layerKeys.includes(tab)" v-bind="gatherLayerProps(layers[tab]!)" :index="index" + @set-minimized="value => (layers[tab]!.minimized.value = value)" /> diff --git a/src/components/Layer.vue b/src/components/Layer.vue index f599543..c687b56 100644 --- a/src/components/Layer.vue +++ b/src/components/Layer.vue @@ -2,7 +2,11 @@
- @@ -12,7 +16,9 @@
- + @@ -40,7 +46,7 @@ export default defineComponent({ }, minimizedDisplay: processedPropType(Object, String, Function), minimized: { - type: Object as PropType>, + type: Object as PropType>, required: true }, name: { @@ -54,6 +60,7 @@ export default defineComponent({ required: true } }, + emits: ["setMinimized"], setup(props) { const { display, index, minimized, minimizedDisplay } = toRefs(props); @@ -67,10 +74,6 @@ export default defineComponent({ player.tabs.splice(unref(props.index), 1); } - function setMinimized(min: boolean) { - minimized.value = min; - } - function updateNodes(nodes: Record) { props.nodes.value = nodes; } @@ -81,8 +84,7 @@ export default defineComponent({ showGoBack, updateNodes, unref, - goBack, - setMinimized + goBack }; } });