wujie icon indicating copy to clipboard operation
wujie copied to clipboard

销毁后报错

Open ljquan opened this issue 2 years ago • 1 comments

描述bug image

如何复现 给出详细的复现步骤 1、第一步 examples/main-vue/src/views/Vue2.vue 文件添加销毁逻辑

<template>
  <!--单例模式,name相同则复用一个无界实例,改变url则子应用重新渲染实例到对应路由 -->
  <WujieVue width="100%" height="100%" :name="name" :url="vue2Url" :sync="true"></WujieVue>
</template>

<script>
import hostMap from "../hostMap";
import { destroyApp } from "wujie";

export default {
  data() {
    return {
      name: Math.random().toString(36),
      vue2Url: hostMap("//localhost:7200/"),
    };
  },
  methods: {
    jump(name) {
      this.$router.push({ name });
    },
  },
  destroyed() {
    const name = this.name;
    destroyApp(name);
  },
};
</script>

<style lang="scss" scoped></style>

2、 第二步 快速切换Vue2和React17或其他tab 错误截图 image

ljquan avatar Dec 14 '23 01:12 ljquan

原因是

    //框架主动调用mount方法
    this.execQueue.push(this.fiber ? () => requestIdleCallback(() => this.mount()) : () => this.mount());

这里requestIdleCallback在销毁后执行了

ljquan avatar Dec 14 '23 02:12 ljquan