浏览代码

fix(cientos): fixed useCientos type issues

Alvaro 2 年之前
父节点
当前提交
34aefc6f3f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/cientos/src/core/useCientos.ts

+ 2 - 2
packages/cientos/src/core/useCientos.ts

@@ -2,8 +2,8 @@ import { useCatalogue } from '@tresjs/core'
 import { getCurrentInstance } from 'vue'
 
 export function useCientos() {
-  const { appContext } = getCurrentInstance()
-  const { catalogue, extend } = useCatalogue(appContext.app)
+  const appContext = getCurrentInstance()?.appContext
+  const { catalogue, extend } = useCatalogue(appContext?.app)
 
   return {
     catalogue,