mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
simplify data usage
This commit is contained in:
1 parent
4033eefa0d
commit
c2c100e6e6
1 file changed
+12
-19
@@ -17,15 +17,16 @@ const marginY = 120
|
|||||||
|
|
||||||
const nodeWidth = 160
|
const nodeWidth = 160
|
||||||
const nodeHeight = 50
|
const nodeHeight = 50
|
||||||
const opened = ref<Node>({
|
// const opened = ref<Node>({
|
||||||
id: '',
|
// id: '',
|
||||||
title: '',
|
// title: '',
|
||||||
x: 0,
|
// x: 0,
|
||||||
y: 0,
|
// y: 0,
|
||||||
index: 0,
|
// index: 0,
|
||||||
completed: false,
|
// completed: false,
|
||||||
unlocked: false,
|
// unlocked: false,
|
||||||
})
|
// })
|
||||||
|
const opened = ref<Node | null>(null)
|
||||||
type Node = {
|
type Node = {
|
||||||
id: string
|
id: string
|
||||||
title: string
|
title: string
|
||||||
@@ -113,15 +114,7 @@ function handleNodeClick(node: Node) {
|
|||||||
}
|
}
|
||||||
function closeIntro(close: boolean) {
|
function closeIntro(close: boolean) {
|
||||||
if (close) {
|
if (close) {
|
||||||
opened.value = {
|
opened.value = null
|
||||||
id: '',
|
|
||||||
title: '',
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
index: 0,
|
|
||||||
completed: false,
|
|
||||||
unlocked: false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +212,7 @@ const edgeStyle = computed(() => {
|
|||||||
:questTitle="opened.title"
|
:questTitle="opened.title"
|
||||||
:questId="opened.id"
|
:questId="opened.id"
|
||||||
:questUnlocked="opened.unlocked"
|
:questUnlocked="opened.unlocked"
|
||||||
v-if="opened.id !== ''"
|
v-if="opened"
|
||||||
@close-intro="closeIntro"
|
@close-intro="closeIntro"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user