The new Vue.js 3.0 plugin architecture is nice, but it seems to to be missing a router plugin. If I choose not to install routing when I first create the project (vue create my-project
), I'd expect that I could change my mind later and add routing with something like vue add @vue/router
, but that plugin doesn't appear to exist. Is there a way to add routing from the CLI after the fact?
After some experimenting with vue-cli3, i found that you can use vue add
to setup components you missed.
Use vue add router
That set up the routing and created some sample components Home and About.
This also work for other modules like adding vuetify with vue add vuetify
. You can read more about vue add from the plugins and presets guide