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.
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)
3. Follow the following steps on the page where data needs to be obtained
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!