Explorar o código

fix: 修改组件注册会报错的问题

奔跑的面条 %!s(int64=3) %!d(string=hai) anos
pai
achega
6ab34a0996
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/views/preview/hooks/useComInstall.hook.ts

+ 1 - 1
src/views/preview/hooks/useComInstall.hook.ts

@@ -8,7 +8,7 @@ export const useComInstall = (localStorageInfo: ChartEditStorageType) => {
 
   // 注册组件(一开始无法获取window['$vue'])
   const intervalTiming = setInterval(() => {
-    if (window['$vue'].component) {
+    if (window['$vue']?.component) {
       clearInterval(intervalTiming)
       localStorageInfo.componentList.forEach(async (e: CreateComponentType) => {
         if (!window['$vue'].component(e.chartConfig.chartKey)) {