当前位置: 移动技术网 > IT编程>开发语言>JavaScript > vue 中promise 异步请求数据

vue 中promise 异步请求数据

2018年11月08日  | 移动技术网IT编程  | 我要评论
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)});//成功

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网