D
D
Dilik Pulatov2019-02-28 11:03:25
Vue.js
Dilik Pulatov, 2019-02-28 11:03:25

How to implement dynamic paths in Vuejs?

Hello!
in View it is possible to implement here such dynamic ways?
For example:

{
  path: '/',
  component: () => import('layouts/MyLayout.vue'),
  children: [
    { path: '', component: () => import('pages/Index.vue') },
    { path: '/about', component: () => import('pages/About.vue') },
    { 
    	path: '/[path]', 
    	component: () => import('pages/[path]/Index.vue'),
    	children: [
    		{ path: '/[view]', component: () => import('pages/[path]/[view].vue') },
    		{ path: '/[view]/:id', component: () => import('pages/[path]/[view].vue') },
    	]
    },
  ]
}

I have a lot of routes in my application... I wanted to somehow adjust the route so as not to write hundreds of lines
if there is an idea for a better one... please advise

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question