码迷,mamicode.com
首页 > 其他好文 > 详细

vue页面加载前根据数据切换钩子函数

时间:2016-08-19 13:19:23      阅读:391      评论:0      收藏:0      [点我收藏+]

标签:

export default { route: { activate: function (transition) { this.$http.patch(‘/api/merchants/‘ + window.user.merchantId + ‘/users/‘ + window.user.id + ‘/items/‘ + this.$route.params.id + ‘/give‘).then(function (response) { if (response.data.data.status) { this.$set(‘data‘, response.data) transition.next() } else { $(‘body>div‘).remove() $.alert(response.data.data.msg, function () { wx.closeWindow() }) } }) } } }

 

参考网站:http://router.vuejs.org/zh-cn/pipeline/hooks.html#transition-object

vue页面加载前根据数据切换钩子函数

标签:

原文地址:http://www.cnblogs.com/zzbp/p/5787120.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!