18 lines
445 B
TypeScript
18 lines
445 B
TypeScript
import { defineStore } from 'pinia'
|
|||
|
|
import { ref, reactive, computed } from 'vue'
|
||
|
|
|
||
|
|
|
||
|
|
export const useRoutesStore = defineStore('routes', () => {
|
||
|
|
const hasRoutes = ref(false)
|
||
|
|
const routes = reactive([])
|
||
|
|
|
||
|
|
// const getSubRoutes = computed((path: string) => routes.find((item: any) => {
|
||
|
|
// console.log('哈哈', path);
|
||
|
|
|
||
|
|
// if (item.path === path) {
|
||
|
|
// return item.children
|
||
|
|
// }
|
||
|
|
// }));
|
||
|
|
|
||
|
|
return { hasRoutes, routes }
|
||
|
|
})
|