logigate/app/pages/puzzle/[id].vue

12 lines
393 B
Vue
Raw Normal View History

<script setup lang="ts">
// A puzzle link: /puzzle/<id> adds that puzzle to the open project and opens it.
const route = useRoute()
const ed = useEditor()
// Only when the app was loaded with it: going back or forward to it later just shows that entry.
onMounted(() => (ed.firstPage() ? ed.openPuzzle(String(route.params.id)) : ed.syncUrl()))
</script>
<template>
<EditorApp />
</template>