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