Skip to content

Commit

Permalink
fix: an exception cannot be thrown normally when imported from outsid…
Browse files Browse the repository at this point in the history
…e the setup
  • Loading branch information
zouyaoji committed Oct 19, 2022
1 parent 15fb4e7 commit d9ce185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/composables/use-vue-cesium/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: zouyaoji@https://github.com/zouyaoji
* @Date: 2021-04-06 09:21:02
* @LastEditTime: 2022-09-11 11:51:57
* @LastEditTime: 2022-10-20 01:49:37
* @LastEditors: zouyaoji
* @Description:
* @FilePath: \vue-cesium@next\packages\composables\use-vue-cesium\index.ts
Expand All @@ -13,7 +13,7 @@ import { vcKey } from '@vue-cesium/utils/config'

export default function useVueCesium(containerId?: string): VcViewerProvider {
const instance = getCurrentInstance()
const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : (instance.parent as any).provides
const provides = instance?.parent === null ? instance.vnode.appContext && instance.vnode.appContext.provides : (instance?.parent as any)?.provides
if ((!provides || !(vcKey in provides)) && !containerId) {
containerId = 'cesiumContainer'
}
Expand Down

0 comments on commit d9ce185

Please sign in to comment.