Skip to content

attaching a router to an existing Vue instance (set the router property) #1117

@chandmk

Description

@chandmk

It appears that router property must be present at the time of Vue instance construction

new Vue({router}).$mount("#app")

I like to do the following

var App = Vue.extend();

// later in the code...
App.router = router;

new App().$mount("#app")

Getting an error
Vue warn]: Error when rendering root instance:
Uncaught TypeError: Cannot read property 'matched' of undefined

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions