Vue.js basic Knowledge (8): Communication with the server

Source: Internet
Author: User

Vue.js can build an app that does not rely on back-end services, but can also interact with the server to synchronize dynamic updates to the interface. Vue-resource implements the service-side communication based on Ajax, JSONP and other technologies.

13th Chapter: Communication with the server

1. Installing and configuring Vue-resource

Installation method: Introduced using the script tag.

(1) Parameter configuration. Divided into the global configuration, component instance configuration and invocation configuration 3, the priority of the higher order.

First, the global configuration.

(2) Headers configuration

Xxx

2. Basic HTTP Calls

(1) Bottom-level method

(2) Convenient method

(3) Request Option Object

(4) Response object

3.restful Call

(1) URL string

(2) Params optional object

(3) Actions optional objects

(4) Options optional objects

4. Interceptors, domain Ajax, promise, and URL templates

5.vue-async-data

6. Problem Resolution: How to send a JSONP request

Vue.js basic Knowledge (8): Communication with the server

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.