Skip to content

Commit ec2235a

Browse files
committed
refactor(vue-cesium): ♻️ improve types
1 parent b805ab3 commit ec2235a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/components/viewer/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
/*
22
* @Author: zouyaoji@https://github.com/zouyaoji
33
* @Date: 2021-09-16 09:28:13
4-
* @LastEditTime: 2022-08-12 11:40:04
5-
* @LastEditors: zouyaoji
4+
* @LastEditTime: 2024-03-17 18:08:40
5+
* @LastEditors: zouyaoji 370681295@qq.com
66
* @Description:
7-
* @FilePath: \10_vue-cesium\packages\components\viewer\src\index.ts
7+
* @FilePath: \vue-cesium\packages\components\viewer\src\index.ts
88
*/
99
import { defineComponent, provide, getCurrentInstance, h, createCommentVNode, withDirectives, computed } from 'vue'
1010
import type { VNode } from 'vue'
1111
import useViewer, { viewerProps } from './useViewer'
1212
import type { VcViewerProps } from './useViewer'
1313
import type {
14+
VcCamera,
1415
VcComponentInternalInstance,
1516
VcDatasource,
1617
VcTerrainProvider,
@@ -86,7 +87,8 @@ const emits = {
8687
wheel: (delta: number) => true,
8788
imageryLayersUpdatedEvent: () => true,
8889
tileLoadProgressEvent: (length: number) => true,
89-
touchEnd: evt => true
90+
touchEnd: evt => true,
91+
'update:camera': (evt: VcCamera) => true
9092
}
9193
export default defineComponent({
9294
name: 'VcViewer',

packages/components/viewer/src/useViewer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,10 @@ export interface VcViewerProps {
18511851
*/
18521852
onTileLoadProgressEvent?: (length: number) => void
18531853
onTouchEnd?: (evt: any) => void
1854+
/**
1855+
* Triggers when the camera has changed by percentageChanged.
1856+
*/
1857+
'onUpdate:camera'?: (evt: VcCamera) => void
18541858
}
18551859

18561860
export interface VcViewerSlots {

0 commit comments

Comments
 (0)