File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template >
22 <v-container >
3- <v-row
3+ <v-row
44 v-for =" (section, index) in sections"
55 :key =" index"
66 >
Original file line number Diff line number Diff line change 44 BlueOS Store Apps
55 </v-app-bar-title >
66 <v-spacer ></v-spacer >
7- <v-btn :to = " buttonRoute " >{{ buttonText }}</v-btn >
7+ <v-btn @click = " navigateTo " >{{ buttonText }}</v-btn >
88 </v-app-bar >
99</template >
1010
1111<script lang="ts" setup>
1212import { computed } from ' vue'
13- import { useRoute } from ' vue-router'
13+ import { useRoute , useRouter } from ' vue-router'
1414
1515const route = useRoute ()
16+ const router = useRouter ()
1617
17- const buttonText = computed ( () => {
18- return route .path === ' /logs' ? ' Home ' : ' Logs '
19- })
18+ const navigateTo = () => {
19+ router . push ( route .path . endsWith ( ' /logs' ) ? ' ./ ' : ' ./logs ' )
20+ }
2021
21- const buttonRoute = computed (() => {
22- return route .path === ' /logs' ? ' / ' : ' /logs '
22+ const buttonText = computed (() => {
23+ return route .path . endsWith ( ' /logs' ) ? ' Home ' : ' Logs '
2324})
2425 </script >
Original file line number Diff line number Diff line change 11// Composables
22import { createRouter , createWebHistory } from 'vue-router'
3+ const DefaultLayout = ( ) => import ( '@/layouts/default/Default.vue' )
4+
5+ const childRoutes = [
6+ {
7+ path : 'logs' ,
8+ name : 'Logs' ,
9+ component : ( ) => import ( /* webpackChunkName: "logs" */ '@/views/Logs.vue' ) ,
10+ } ,
11+ {
12+ path : '' ,
13+ name : 'Home' ,
14+ component : ( ) => import ( /* webpackChunkName: "home" */ '@/views/Home.vue' ) ,
15+ } ,
16+ ]
317
418const routes = [
519 {
6- path : '/dist|BlueOS-Extensions-Repository|' ,
7- component : ( ) => import ( '@/layouts/default/Default.vue' ) ,
8- children : [
9- {
10- path : '' ,
11- name : 'Home' ,
12- // route level code-splitting
13- // this generates a separate chunk (about.[hash].js) for this route
14- // which is lazy-loaded when the route is visited.
15- component : ( ) => import ( /* webpackChunkName: "home" */ '@/views/Home.vue' ) ,
16- } ,
17- {
18- path : 'logs' ,
19- name : 'Logs' ,
20- component : ( ) => import ( /* webpackChunkName: "logs" */ '@/views/Logs.vue' ) ,
21- } ,
22- ] ,
20+ path : '/dist' ,
21+ component : DefaultLayout ,
22+ children : childRoutes ,
23+ } ,
24+ {
25+ path : '/BlueOS-Extensions-Repository' ,
26+ component : DefaultLayout ,
27+ children : childRoutes ,
2328 } ,
2429]
2530
You can’t perform that action at this time.
0 commit comments