Front-end vue routing parameters



1. Use routing to pass parameters and open in a new interface (function mode)

Click the button to open the route in the new interface and transfer parameters

Passage:

AddBatch(monthid, partname) {
    
    
        console.log(monthid);
        console.log(partname);
        const {
    
    
          href
        } = this.$router.resolve({
    
    
          name: 'addbatch',
          query: {
    
    
            productname: this.productname, // 传过去产品Id
            partname: partname, // 传过去产品的名字
            month: this.month, // 把年份传过去
            monhtid: monthid, // 把月份 id 传过去
          }
        })
        window.open(href, '_blank')
      },

Accept parameters:

          this.PageInti.productname = this.$route.query.productname,
          this.PageInti.partname = this.$route.query.partname,
          this.PageInti.monthname = this.$route.query.month,
          this.PageInti.monthid = this.$route.query.monthid



2. Use router link tags

Just add target='_blank' attribute to it directly, anyway, it will eventually be interpreted as an a tag

<router-link :to="{path: '/footer'}"  target="_blank"  tag="a">
footer
</router-link>

Guess you like

Origin blog.csdn.net/zhaozhao236/article/details/112668300