0
点赞
收藏
分享

微信扫一扫

OpenShift 4 - 了解 OpenShift 是如何使用节点本地镜像缓存

最近在写看板,要求执行某个操作后更改路由参数,方便用户保存地址以便于下次直接获取对应的数据。

比如:原地址:http://localhost:4200/tvType/out
执行某个操作后,地址变更为:http://localhost:4200/tvType/out?currentStep=BMCL&currentStepName=%E8%A1%A8%E9%9D%A2%E5%A4%84%E7%90%86

下面介绍步骤:

解决步骤1:更改路由参数

执行某个操作后,拿到this.currentStepthis.currentStepName参数,然后更改到路由中。

let url = `/tvType/out?currentStep=${this.currentStep}&currentStepName=${this.currentStepName}`;
window.history.replaceState(
  {
    path: url,
  },
  '',
  url
);

解决步骤2:根据路由获取数据

const { currentStep, currentStepName } = this.$route.query;
this.currentStep = currentStep;
this.currentStepName = currentStepName;
this.getData();//获取数据的接口
举报

相关推荐

0 条评论