Home > Web Front-end > Vue.js > How to request backend data in vue

How to request backend data in vue

coldplay.xixi
Release: 2020-11-30 15:49:31
Original
23170 people have browsed it

How vue requests back-end data: First, create the interface js file in the api folder; then determine the baseURL and url suffix; finally enter the code that needs to obtain the data.

How to request backend data in vue

The operating environment of this tutorial: windows10 system, vue2.9, this article is applicable to all brands of computers.

[Recommended related articles: vue.js]

Vue’s method of requesting back-end data:

1. In the api folder, create an interface js file (example: vxetable.js)

2. Determine the baseURL (interface address, if there is no server, it can be local) and the url suffix (i.e. in the control layer interface path) (jokerls.cn:9090 in the example is the example interface address)

How to request backend data in vue

3. Follow the following steps on the page where data needs to be obtained

How to request backend data in vue

Related free learning recommendations: javascript (video)

The above is the detailed content of How to request backend data in vue. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
vue
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template