-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About @vue/compat
, axios
is introduced globally, axios.post
cannot be accessed properly
#4872
Comments
If you check Remember to use the forum or the Discord chat to ask questions! |
@posva When I comment out '@vue/compat',
|
Duplicate of #4403 |
A short explanation: In Vue 2, we added global properties by extending the prototype. To mimic this with |
Workaround/hack: axios.bind = () => axios
app.config.globalProperties.$axios = axios |
Thank you for your help, I have been puzzled by this problem for a long time.Now it's time to happily continue playing |
Version
3.2.20
Reproduction link
github.com
Steps to reproduce
npm run serve
What is expected?
In the
App.vue
file,logthis.$axios.post
isundefined
What is actually happening?
In the
App.vue
file,logthis.$axios.post
isvalid
The text was updated successfully, but these errors were encountered: