[Vuejs]-The vue.resource() method and the api.json file

0👍

You can take a reference from the vue-hackernews-2.0 code, You can do whatever action you want to do, and than call this.$router.replace("/your/path") to redirect to desired page. Here is the stripped code from the repo:

  methods: {
    loadItems (to = this.page, from = -1) {
      this.loading = true
      this.$store.dispatch('FETCH_LIST_DATA', {
        type: this.type
      }).then(() => {
          this.$router.replace(`/${this.type}/1`)
          return
        this.loading = false
      })
    }

Leave a comment