返回首页 | 新开户送体验金的娱乐城

合作共赢、快速高效、优质的网站建设提供商

更多精品源码-尽在织梦模板-www.moke8.com

网站开发详解Vue整合axios的实例代码

时间:2017-09-05 编辑:admin

// create the app instance. // here we inject the router and store to all child components, // ****** them available everywhere as `this.$router` and `this.$store`. const app = new Vue({ router, store, ...App // expose the app, the router and the store. // note we not mounting the app here, since bootstrapping will be // different depending on whether we are in browser or on the server. export { app, router, store };

在vuex action 中运用:

actions: {
// adList
[TypesAds.AD_GET_LIST](ctx, params){
return Vue.http.get('/v1/api/ads/list', {params}).then(data= {
ctx.commit(TypesAds.AD_GET_LIST, data);
return data;
}).catch(err= {
//一致错误处理
Vue.$message.error(err.msg);


浏览:

网站建设

流程

    网站建设流程