如何在window上挂载全局属性
创建一个 global.d.ts
import * as C from "cesium";
// 扩展全局变量
declare global {
// 定义全局Cesium类型
const Cesium: typeof C;
// 允许扩展 Window
interface Window {
Cesium: typeof C;
}
}
创建一个 global.d.ts
import * as C from "cesium";
// 扩展全局变量
declare global {
// 定义全局Cesium类型
const Cesium: typeof C;
// 允许扩展 Window
interface Window {
Cesium: typeof C;
}
}