diff --git a/src/components/app/t-gameNav.vue b/src/components/app/t-gameNav.vue index 7ea3e27f..c7fd6191 100644 --- a/src/components/app/t-gameNav.vue +++ b/src/components/app/t-gameNav.vue @@ -27,8 +27,7 @@ import { computed, onMounted, ref, shallowRef, watch } from "vue"; import ToLivecode from "./to-livecode.vue"; -type TGameNavProps = { modelValue: number }; -const props = withDefaults(defineProps(), { modelValue: 2 }); +const model = defineModel({ default: 2 }); const { isLogin } = storeToRefs(useAppStore()); const nav = shallowRef([]); @@ -46,12 +45,12 @@ const hasNav = computed(() => { onMounted(async () => await loadNav()); watch( - () => props.modelValue, + () => model.value, async () => await loadNav(), ); async function loadNav(): Promise { - nav.value = await ApiHubReq.home(props.modelValue); + nav.value = await ApiHubReq.home(model.value); } async function tryGetCode(): Promise { @@ -121,7 +120,7 @@ async function toBBS(link: URL): Promise { } if (link.hostname === "forum") { const forumId = link.pathname.split("/").pop(); - const localPath = `/posts/forum/${props.modelValue}/${forumId}`; + const localPath = `/posts/forum/${model.value}/${forumId}`; await emit("active_deep_link", `router?path=${localPath}`); return; }