跳至内容

useDataSourceScope

将“DataSourceCollection”操作的副作用范围化,并在卸载时自动删除

Usage

ts
TODO;

Type Definitions

typescript
import type { CesiumDataSource } from '@vesium/shared';
import type { DataSourceCollection } from 'cesium';
import type { MaybeRefOrGetter } from 'vue';
export interface UseDataSourceScopeOptions {
    /**
     * The collection of DataSource to be added
     * @default useViewer().value.dataSources
     */
    collection?: MaybeRefOrGetter<DataSourceCollection | undefined>;
    /**
     * The second parameter passed to the `remove` function
     *
     * `dataSources.remove(dataSource,destroyOnRemove)`
     */
    destroyOnRemove?: boolean;
}
/**
 * Scope the SideEffects of `DataSourceCollection` operations and automatically remove them when unmounted
 */
export declare function useDataSourceScope(options?: UseDataSourceScopeOptions): import("..").UseCollectionScopeReturn<CesiumDataSource, any[], any[], any>;
//# sourceMappingURL=index.d.ts.map