フロントエンドのvueルーティングパラメータ



1.ルーティングを使用してパラメーターを渡し、新しいインターフェイスで開きます(関数モード)

ボタンをクリックして、新しいインターフェイスでルートを開き、パラメータを転送します

通路:

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')
      },

パラメータを受け入れる:

          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.ルーターリンクタグを使用する

target = '_ blank'属性を直接追加するだけで、とにかく、最終的にはタグとして解釈されます

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

おすすめ

転載: blog.csdn.net/zhaozhao236/article/details/112668300