add route page to recent when menu load
This commit is contained in:
@ -116,10 +116,6 @@ import { useCommandPalattesStore } from '@/stores/command'
|
||||
import { navigationIcon } from '@/utils/route'
|
||||
|
||||
const command = useCommandPalattesStore()
|
||||
const searchRoutesByName = (routes: RouteRecordRaw[], query: string): RouteRecordRaw[] => {
|
||||
const matchingRoutes = extractLeafRoutes(routes, '').filter((item: RouteRecordRaw) => item.path.includes('home/') && item.name?.toString().toLocaleLowerCase().includes(query.toLocaleLowerCase()))
|
||||
return matchingRoutes
|
||||
}
|
||||
|
||||
const route = useRouter()
|
||||
const recent = computed(() => query.value === '' ? command.readRecent() : [])
|
||||
@ -127,7 +123,7 @@ const query = ref('')
|
||||
const filteredMenus = computed(() =>
|
||||
query.value === ''
|
||||
? []
|
||||
: searchRoutesByName(routes, query.value)
|
||||
: command.searchRoutesByName(routes, query.value)
|
||||
)
|
||||
const onClose = () => command.open = false
|
||||
|
||||
|
@ -112,7 +112,7 @@ const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
|
||||
onMounted(() => {
|
||||
createDummy()
|
||||
console.log(readDataJson('data-daftar-1'));
|
||||
// console.log(readDataJson('data-daftar-1'));
|
||||
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user