Skip to content

Commit 133fe29

Browse files
committed
Remove handling of router/vuex
1 parent fa22f41 commit 133fe29

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/index.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,15 @@ function render(
2424
const baseElement = customBaseElement || customContainer || document.body
2525
const container = customContainer || baseElement.appendChild(div)
2626

27-
const plugins = mountOptions.global?.plugins || []
28-
29-
if (store) {
30-
const {createStore} = require('vuex')
31-
plugins.push(createStore(store))
32-
}
33-
34-
if (routes) {
35-
const requiredRouter = require('vue-router')
36-
const {createRouter, createWebHistory} =
37-
requiredRouter.default || requiredRouter
38-
39-
const routerPlugin = createRouter({history: createWebHistory(), routes})
40-
plugins.push(routerPlugin)
27+
if (store || routes) {
28+
console.warn(`Providing 'store' or 'routes' options is now deprecated.
29+
You need to create a router/vuex plugin and provide it through 'global.plugins'.
30+
See here for more information:`)
4131
}
4232

4333
const wrapper = mount(Component, {
4434
...mountOptions,
4535
attachTo: container,
46-
global: {...mountOptions.global, plugins},
4736
})
4837

4938
// this removes the additional "data-v-app" div node from VTU:

0 commit comments

Comments
 (0)