refactor(deps): migrate to nuxt v4

This commit is contained in:
2026-02-10 00:31:04 +08:00
parent f1b9cea060
commit 880b85f75d
88 changed files with 80 additions and 60 deletions

View File

@@ -0,0 +1,39 @@
export const useTourState = defineStore(
'tour_state',
() => {
const tourState = ref<{ [key: string]: boolean }>({})
const isTourDone = (tourId: string) => tourState.value[tourId] || false
const setTourDone = (tourId: string) => {
tourState.value = {
...tourState.value,
[tourId]: true,
}
}
const autoDriveTour = (
tourId: string,
driver: ReturnType<typeof useDriver>
) => {
if (isTourDone(tourId)) return
driver.setConfig({
...driver.getConfig(),
onDestroyed: () => setTourDone(tourId),
})
driver.drive()
}
return {
tourState,
isTourDone,
setTourDone,
autoDriveTour,
}
},
{
persist: {
key: 'xsh_assistant_tour_state',
storage: piniaPluginPersistedstate.localStorage(),
paths: ['tourState'],
},
}
)