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

Logo

前往低代码交流专区

更多推荐