taro 路由快速切换,导致页面白屏

bqjvbblv  于 22天前  发布在  其他
关注(0)|答案(2)|浏览(18)

相关平台

H5

浏览器版本: 微信浏览器,Microsoft Edge 版本 117.0.2045.47 (正式版本) (64 位)
使用框架: Vue 3

复现步骤

  1. 从A页面跳转到B页面;
  2. 在B还没渲染完成时立即返回上一页(返回A)
  3. A页面对应的dom的style会变成display:none(白屏)

期望结果

展示A页面

实际结果

白屏

环境信息

Taro CLI 3.6.11 environment info:
    System:
      OS: Windows 10 10.0.19044
    Binaries:
      Node: 20.2.0 - D:\SofeWare\node\node.EXE
      npm: 8.1.0 - D:\SofeWare\node\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.11 => 3.6.11
      @tarojs/components: 3.6.11 => 3.6.11
      @tarojs/helper: 3.6.11 => 3.6.11
      @tarojs/plugin-framework-vue3: 3.6.11 => 3.6.11
      @tarojs/plugin-html: ^3.6.12 => 3.6.12
      @tarojs/plugin-platform-alipay: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-h5: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-jd: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-qq: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-swan: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-tt: 3.6.11 => 3.6.11
      @tarojs/plugin-platform-weapp: 3.6.11 => 3.6.11
      @tarojs/plugin-vue-devtools: 3.6.11 => 3.6.11
      @tarojs/runtime: 3.6.11 => 3.6.11
      @tarojs/shared: 3.6.11 => 3.6.11
      @tarojs/taro: 3.6.11 => 3.6.11
      @tarojs/taro-loader: 3.6.11 => 3.6.11
      @tarojs/webpack5-runner: 3.6.11 => 3.6.11
      babel-preset-taro: 3.6.11 => 3.6.11
      eslint-config-taro: 3.6.11 => 3.6.11
py49o6xq

py49o6xq1#

目前我只能通过js异步控制

onShow() {
    // 修复页面快速切换导致白屏的问题
    nextTick(() => {
      nextTick(() => {
        this.$el.parentNode.style.display = "";
      });
    });
  },
iibxawm4

iibxawm42#

有解决办法吗?我也有这样的问题 @ZakaryCode

相关问题