Axios How to use

Source: Internet
Author: User
We know that after vue2.0, Vue will not update the Vue-resource, but recommend Axios, and large projects will use VUEX to manage the data, so this blog will be combined to send a request 1. Install AXIOSCNPM I Axios- S2. Scenario One: Modifying the prototype chain first, introduced in Main.js at this time, you still cannot use Axios in the component, but if you change Vue to the prototype chain of Vue, you can solve this problem, such as 3. Start sending request 5. Request with parameters if you want to send a request with a JSON-formatted parameter, you will need to use the QS module to process the parameters first import the QS module in Main.js and then use the QS processing parameter to return the result as follows 6. Shorthand for callback function 7. Note If used in Vue, Then the data in Vue cannot be referenced directly by this, and the following processing is required to reprint to: https://www.cnblogs.com/hdnav/p/7596644.html

Axios How to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.