Skip to content

Error in render: "TypeError: parentVal.concat is not a function" #58

@Ge-yuan-jun

Description

@Ge-yuan-jun

demo link

Repeatable demo link: https://github.com/Ge-yuan-jun/vue-routing-demo

expectation

change code in router/index.js & main.js, the plugin should still work

When I use this plugin by default config, It works.

But when I change the router config, modify the index.js in router folder like this:

router/index.js

import routes from 'vue-auto-routing'
import { createRouterLayout } from 'vue-router-layout'

const RouterLayout = createRouterLayout(layout => {
  return import('@/layouts/' + layout + '.vue')
})

const generateRoutes = [
  {
    path: '/',
    component: RouterLayout,
    children: routes
  }
]

export default generateRoutes

and add cde like this in main.js

import Vue from 'vue'
import Router from 'vue-router'
import App from './App.vue'
import routes from './router'

Vue.use(Router)

Vue.config.productionTip = false

const router = new Router({
  routes
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')

result

when I load the page, it shows the error 'Error in render: "TypeError: parentVal.concat is not a function"'

image

what I want

I want to know if the plugin can work if I change export varaible like the demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions