动态组件渲染(小妙招)

22 阅读1分钟

通过 shallowRef 存储组件引用,并在需要时动态切换组件。例如: const comp = shallowRef(Home); store.switchComponent(component);