vue頁面跳轉(跳轉傳值)

//詳情 點擊事件觸發 路由 跳轉

    detail(index) {

      this.$router.push({//路由的組件

        path: "/huaxiainsuranceDetail",//路透跳轉的地址

        query: {//路由跳轉,攜帶的參數

          applyNoDetail: this.insuranceList[index].applyNo//參數

        }

      });

    },

1.當點擊按鈕,detail事件時,發生頁面跳轉。

2.將本頁面的參數this.insuranceList[index].applyNo綁定給applyNoDetail

在/huaxiainsuranceDetail 頁面 取出 參數 applyNoDetail 方法爲

this.$route.query. applyNoDetail //可以全局使用

如果想攜帶多個值,用“,”逗號隔開

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章