1: Description of the problem
I am new to front-end. When I was learning Vue's front-end and back-end separation projects, I used vue add axios to install plug-ins to prepare for front-end and back-end data interaction. A Cannot read properties of undefined (reading 'use') error occurred.
Two: Cause of the problem
Vue2 uses: Vue.use(Plugin) when installing plug-ins , but this method is no longer supported in Vue3
Three: Problem Solving
1. Find in the directory src->plugins->axios.js and Vue.use(Plugin)
delete or comment it out
2. Add this line of code under main.js
createApp(App).use(store).use(axios).mount('#app')
It’s ready to run