Vue-页面跳转

一: 开发新标签

--  跳转不带参数
userFeedback() {
      // this.$router.push({ path: '/feedback' });
      用push,也能实现跳转,但是不能打开新页面。
      const { href } = this.$router.resolve({
        path: '/feedback'
      });
      window.open(href, '_blank');
    },
window.open(href, "_blank");

-- 跳转带参数
const { href } = this.$router.resolve({
      path: `/answerSituation`,
      query: {
        id: row.id,
        paperName: this.paperName,
        name: row.name,
        examScore: row.examScore,
        answersTime: row.answersTime
      }
    });
    window.open(href, '_blank');

二:打开新窗口

--  跳转不带参数
userFeedback() {
      // this.$router.push({ path: '/feedback' });
      用push,也能实现跳转,但是不能打开新页面。
      const { href } = this.$router.resolve({
        path: '/feedback'
      });
      window.open(href, '_blank');
    },
window.open(href, "_blank", "width=1920px,height=1080px");

-- 跳转带参数
const { href } = this.$router.resolve({
      path: `/answerSituation`,
      query: {
        id: row.id,
        paperName: this.paperName,
        name: row.name,
        examScore: row.examScore,
        answersTime: row.answersTime
      }
    });
window.open(href, "_blank", "width=1920px,height=1080px");

三:当前页面跳转

jumpDetails(e) {
      console.log(e);
         this.$router.push({
               path: e.situation === 10 ? "/WeiboDetails" : "/NewsDetails",
               query: {
                     msgKey: e.msgKey,
                   situation: e.situation,
                },
         });
}