main.js
//引入element-plus
import ElementPlus from "element-plus"
import "element-plus/theme-chalk/index.css"
app.use(ElementPlus)
//引入webgl3d组件包
import webgl3d from "@supermap/iclient3d-vue-for-webgl"
app.use(webgl3d)
index.html
<link href="./index.css" rel="stylesheet">
<link href="./Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="./Cesium/Cesium.js"></script>
.vue
<sm3d-viewer class="map-container"
scene-url="http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace">
</sm3d-viewer>
这么使用之后,三维球没有显示处理,似乎是组件没有注册成功,应该怎么引入supermap/iclient3d-vue-for-webgl组件呢?以下是浏览器控制台的警告
[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement
[Vue warn]: Invalid VNode type: Symbol(Fragment) (symbol)
at <Sm3dViewer class="map-container" scene-url="http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace" >
at <App>
[Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.
at <Sm3dViewer class="map-container" scene-url="http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace" >
at <App>