1

I had some problems trying out the vue3.

router is my custom.

import router from './router'

when i write

createApp(App).use(Antd,VueAxios,axios,qs,router).mount('#app')

The page does not load the correct page.Vue Router Looks like not working but when i write

createApp(App).use(router,Antd,VueAxios,axios,qs).mount('#app')

it's working! So why?

code:https://github.com/fangminghui/app_h5

1 Answer 1

2

app.use or createApp(App).use doesn't accept multiple plugin as parameters, it accepts only the plugin and its options if there's options :

createApp(App).use(thePlugin,options)

if you want to use multiple ones you should chain multiple .use like :

createApp(App).use(qs).use(router).use(VueAxios).use(Antd).mount('#app')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.