vue 中promise 异步请求数据

mac2022-06-30  39

export function getTypes(type) { return listDictItems({ code: type }).then((res) => { if (res.code == 200) { let list = res.body; // console.log('list',list); return list; } }) };

组件中:

 getTypes('EP_TYPE').then((data) => {console.log('data',data)});//成功

更多专业前端知识,请上 【猿2048】www.mk2048.com
最新回复(0)