import router from '@/router/index';
index.ts
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'home',
component: () => import('../views/Index.vue'),
meta: { requireAuth: true, title: 'sample app' }
},
取得網址: process.env.BASE_URL+router.resolve({ name: 'xxx' }).href
導向網址: router.push({ name: 'xxx', query: {p1: 123} })
沒有留言:
張貼留言