Vue reported exception: 8080/#/:2961 Uncaught TypeError: Cannot read property 'matched' of undef

vue reports exception

   

:8080/#/:2961 Uncaught TypeError: Cannot read property 'matched' of undefined

 reason:

   The vue constructor needs to strictly follow the standard;

   For example, routers are called  routers

 

import router from './routes.js'

const app = new View({
  the: '#app',
  router,
  render: h => h(App)
})
The above is correct;


The following is wrong:
import rou from './routes.js'

const app = new View({
  the: '#app',
  rou,
  render: h => h(App)
})

 The route name must be: router

 

If you want to customize:

import routes from './routes.js'

const app = new View({
  the: '#app',
  router: routes,
  render: h => h(App)
})

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326521733&siteId=291194637