两种取值方式

第一种 this.$route.params.lib_id

第一种是用于以下情况

<router-link :to="'/goodsinfo/'+ subitem.artID"  class="">
    <div class="img-box">
        <img  v-lazy =subitem.img_url>
    </div>
    <div class="info">
        <h3>{{subitem.artTitle}}</h3>
        <p class="price">
            <b>{{subitem.sell_price}}</b>元</p>
        <p>
            <strong>库存 {{subitem.stock_quantity}}</strong>
            <span>市场价:
                <s>{{subitem.market_price}}</s>
            </span>
        </p>
    </div>
</router-link>

第二种 this.$route.query.lib_id

  this.$router.push({ path: `/library/targets?lib_id=${index.LibId}` })
   //获取id
   let req_lib_id = this.$route.query.lib_id
Logo

前往低代码交流专区

更多推荐