Props 组件属性 Props
| 序号 | 名称 | 类型 | 必须? | 默认值 | 含义 | 备注 |
|---|---|---|---|---|---|---|
| 1 | viewer | Cesium.Viewer | 是 | - | viewer对象 | - |
<template> <div id="rootContainer" ref="rootContainer" class="root-container"> <!-- v-if="viewer" 可选 --> <cp-compass class="right-top-plugin" :viewer="viewerLoc"></cp-compass> </div></template>import { onMounted, ref } from "vue";import { cpRuler } from 'cesium-pocket'import 'cesium/Build/Cesium/Widgets/widgets.css';
let viewer: any = ref(null)
onMounted(() => { viewer.value = //你获取的viewer});.root-container { position: relative; width: 100%; box-sizing: border-box; height: 500px;}
.right-top-plugin { position: absolute; top: 20px; right: 20px; z-index: 10;}<cp-compass :viewer="viewer"> | 序号 | 名称 | 类型 | 必须? | 默认值 | 含义 | 备注 |
|---|---|---|---|---|---|---|
| 1 | viewer | Cesium.Viewer | 是 | - | viewer对象 | - |