在vuex中设置一个state loading默认为false;然后创建一个mutations为loading赋值;

再通过router的钩子函数在beforeEach中调用store中的mutations为loading赋值为true;

在afterEach中复制为false;

再在app.vue中设置你自己的loading逐渐,根据state中的loading值去显示和隐藏

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2021-06-14
  • 2021-07-24
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案