vue——keep-alive缓存问题

搬运自:https://blog.csdn.net/dongguan_123/article/details/80910231

 我的问题:列表页  > 详情页a  > 支付页  >   返回到列表页  > 详情页b  >  支付页  >  返回(出错-显示为详情页a)

created() {
      if(this.goodsId !== this.$route.query.goodsId) {
        this.$destroy(); //完全销毁一个实例。清理它与其它实例的连接,解绑它的全部指令及事件监听器。
      }
      this.goodsId = this.$route.query.goodsId;
      this.getGoodsInfo();
    }
原文地址:https://www.cnblogs.com/linjiangxian/p/11934442.html