refactor: simplify page models and view driver usage

Move simple page models into page components and build trivial computed
models directly in views to avoid unnecessary page drivers. Update views
to destructure page driver returns and rely on template ref unwrapping,
and document the guidance for when page drivers should be introduced.refactor: simplify page models and view driver usage

Move simple page models into page components and build trivial computed
models directly in views to avoid unnecessary page drivers. Update views
to destructure page driver returns and rely on template ref unwrapping,
and document the guidance for when page drivers should be introduced.
This commit is contained in:
skytek_xinliang
2026-05-27 11:10:34 +08:00
parent 799b16578d
commit b8664b5c3e
19 changed files with 139 additions and 220 deletions
+7 -2
View File
@@ -1,8 +1,13 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import PageFunction from '@/components/pages/PageFunction.vue'
import { useFunctionPage } from '@/composables/page-drivers/useFunctionPage'
import type { FunctionPageModel } from '@/components/pages/PageFunction.vue'
const { pageModel } = useFunctionPage()
const route = useRoute()
const pageModel = computed<FunctionPageModel>(() => ({
fncId: String(route.params.fncId ?? ''),
}))
</script>
<template>