瀏覽代碼

feat(cientos): getting app from getCurrentInstance 🤩

Alvaro 2 年之前
父節點
當前提交
f899977f25
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/cientos/src/core/useCientos.ts

+ 3 - 1
packages/cientos/src/core/useCientos.ts

@@ -1,7 +1,9 @@
 import { useCatalogue } from '@tresjs/core'
+import { getCurrentInstance } from 'vue'
 
 export function useCientos() {
-  const { catalogue, extend } = useCatalogue(window.__TRES__.app)
+  const { appContext } = getCurrentInstance()
+  const { catalogue, extend } = useCatalogue(appContext.app)
 
   return {
     catalogue,