mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
fix method
This commit is contained in:
1 parent
84cf74cdfc
commit
66adfec365
2 files changed
+8
-17
No files matched your search
@@ -8,7 +8,7 @@ import CompleteAnimation from '../img/complete-animation.json'
|
|||||||
|
|
||||||
const showModal = ref(true) // Controls whether the modal is visible or not
|
const showModal = ref(true) // Controls whether the modal is visible or not
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const toast = useToast()
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
showModal.value = false
|
showModal.value = false
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ const backtoMap = async () => {
|
|||||||
router.push({ name: 'map' })
|
router.push({ name: 'map' })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// useToast().error('Failed to load map')
|
// useToast().error('Failed to load map')
|
||||||
useToast().error('無法讀取地圖')
|
toast.error('無法讀取地圖')
|
||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,22 +77,13 @@ const genOption = (nodes, edges) => ({
|
|||||||
const {
|
const {
|
||||||
data: { completed, unlocked },
|
data: { completed, unlocked },
|
||||||
} = params
|
} = params
|
||||||
switch (completed !== unlocked) {
|
if (completed) {
|
||||||
case false: {
|
return '#00ff00'
|
||||||
// completed==unlocked, when completed or not yet unlocked
|
|
||||||
if (completed) {
|
|
||||||
return '#00ff00'
|
|
||||||
}
|
|
||||||
return '#454552'
|
|
||||||
}
|
|
||||||
case true: {
|
|
||||||
// completed!=unlocked, only when unlocked but not completed
|
|
||||||
return '#ADADB5'
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return '#454552'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (unlocked) {
|
||||||
|
return '#ADADB5'
|
||||||
|
}
|
||||||
|
return '454552'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user