diff --git a/docs/demo/src/WTA/wwwroot/components/list/index.js b/docs/demo/src/WTA/wwwroot/components/list/index.js index b5a3f5f7..f8314eda 100644 --- a/docs/demo/src/WTA/wwwroot/components/list/index.js +++ b/docs/demo/src/WTA/wwwroot/components/list/index.js @@ -225,6 +225,7 @@ export default { const selectedRows = ref([]); const dialogVisible = ref(false); const route = useRoute(); + const router = useRouter(); const { t } = useI18n(); const buttons = ref(props.buttons ?? route.meta.buttons); const baseUrl = props.controller ?? `${route.meta.controller}`; @@ -389,10 +390,22 @@ export default { }; const showList = (value, nav) => { if (!subDrawer.value) { + const controller = nav.substr(0, nav.lastIndexOf(".")).toLowerCase(); + const findRoute = (tree) => { + for (const item of tree) { + if (item.meta.controller === controller) { + return item; + } + if (item.children) { + return findRoute(item.children); + } + } + }; + const targetRoute = router.getRoutes().find((o) => o.meta?.controller === controller); subListQuery.value = { - controller: nav.substr(0, nav.lastIndexOf(".")), + controller, query: { [nav.substr(nav.lastIndexOf(".") + 1)]: value }, - buttons: [], + buttons: targetRoute.meta.buttons, }; subDrawer.value = true; } diff --git a/docs/demo/src/WTA/wwwroot/layouts/menu-item.js b/docs/demo/src/WTA/wwwroot/layouts/menu-item.js index 8c32f8ef..2c075373 100644 --- a/docs/demo/src/WTA/wwwroot/layouts/menu-item.js +++ b/docs/demo/src/WTA/wwwroot/layouts/menu-item.js @@ -6,7 +6,11 @@ import { useRouter } from "vue-router"; export default { name: "menuItem", components: { Icon }, - template: html` + template: html`