摘要:
import axios from 'axios' export function request(config){ return new Promise((resolve, reject) => { //1.创建实例--配置 const instance = axios.create({ baseURL: '地址', timeout: 5000 }) //2.axi... 阅读全文
摘要:
引用、 建议 引用 promise异步操作 其实这里的 调用 阅读全文
摘要:
//安装axios npm install axios --save //导入 import axios from 'axios' axios({ url: '接口地址',//可拼接 ?参数&参数2 method: 'get', params: { 参数 } params: { 参数 } param 阅读全文
摘要:
//在这里做异步逻辑操作,类似于mutations,但是不能在mutations 里做异步,工具监听不到 actions: { aupdateinfo(context,payload){ context.commit('调用mutations 中的方法') } }, //在这里做异步逻辑操作,类似于 阅读全文
摘要:
//方法 mutations: { //加上一个动态传参 incrementCount(state, count) { state.counter += count } }, 界面传参 methods: { addCount(count) { this.$store.commit('incremen 阅读全文
摘要:
过滤器函数使用户的案例 //单一状态数 state: { //是一个数组对象 students: [ {id: 10, name: 'ha', age: 18}, {id: 10, name: 'ha', age: 18}, {id: 10, name: 'ha', age: 18}, ] }, 计 阅读全文