Failure of vue project router-link using this.$router.back / this.$router.go (- 1)

Jump to another routing page with id via router-link. When you click the button of the router-link tag of this.$router.back / this.$router.go (- 1), you cannot return to the previous page, but click the fallback button on the browser to return to

successfully.
    <!--  -->
    <router-link to="this.$router.back" v-if="!this.$route.meta.showTabbar" slot="left">
        <mt-button icon="back"></mt-button>
      </router-link>

<!--  -->
{ path: "/home/newslist", component: NewsList, name: ""},
    { path: "/home/newsinfo/:id", component: NewsInfo, name: ""}
<!--  -->

    <router-link :to=""/home/newsinfo/" + item.id">
              <img class="mui-media-object mui-pull-left" :src="item.img_url">
              <div class="mui-media-body">
                <h1>{{ item.title }}</h1>
                <p class="mui-ellipsis">
                  <span>:{{ item.add_time }}</span>
                  <span>:{{item.click}}</span>
                

</div> </router-link>

clipboard.png

clipboard.png

clipboard.png

Jul.08,2022

The

to attribute is the routing path, and to= "this.$router.back" actually means

this.$router.push("this.$router.back")

you can't get back to the next level.

Menu