- Download the plugin
pocky-request
:Address 1: UNI – Plug-in Market 与 Address 2: Github - Address will automatically generate directory, as shown below. Address 2 can be manually added
- Mount to vUE
main.js
import Vue from 'vue'
import App from './App'
/ / = = = = = = the import
import Request from '/ js_sdk/pocky - request/pocky - request - v. 2.0.4 / index js'
Vue.config.productionTip = false
/ / = = = = = = = mount
Vue.prototype.$axios = Request()
App.mpType = 'app'
const app = newVue({ ... App }) app.$mount()Copy the code
- Basic configuration, baseURL, etc
5. Initiate a request
getArcList(interval, info) {
this.$axios.request({
url: 'infos/informations/'.method: 'get'.params: {
interval
}
}).then(res= > {
this[info] = res.data.dataInfo.listData
})
}
Copy the code
- Have good beginning
Attached the official document: www.yuque.com/pocky/aaeyu…