From 046ebfc62f2112cef4e99e03cdf48fe5f44e4ef8 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Sun, 1 Mar 2026 01:28:11 +0700 Subject: [PATCH] add collapse item --- src/components/GameWindow.vue | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/GameWindow.vue b/src/components/GameWindow.vue index c2018f2..055d997 100644 --- a/src/components/GameWindow.vue +++ b/src/components/GameWindow.vue @@ -17,6 +17,8 @@ type Action = { name: string text: string applications: Application[] + + isOpen: boolean } type Team = { @@ -72,8 +74,16 @@ function getTeam() { return res }) .then(data => { + const oldActions = team.value.actions + team.value = data const newActions = team.value?.actions + newActions.forEach(item => { + item.isOpen = true + }) + for (let i = 0; i < actions.value.length; i++) { + newActions[i].isOpen = oldActions[i].isOpen + } if (actions.value.length !== newActions?.length) { actions.value = newActions } @@ -216,14 +226,18 @@ onMounted(() => {
{{ action.place }}: {{ action.name }} + {{ + action.isOpen ? '−' : '+' }}
-
-
+
+
+
{{ action.text }} -
-
- +
+
@@ -326,4 +340,9 @@ body { text-align: center; width: 200px; } + +.collapse-icon { + padding: 0 15px; + cursor: pointer; +}