Load the Cesium official build package or other third-party Cesium packages (such as the Superap WebGL build package) to the Vue component.
https://zouyaoji.top/vue-cesium
npm i --save vue-cesium
import Vue from 'vue'
import VueCesuium from 'vue-cesium'
Vue.use(VueCesium, {
// cesiumPath is the path of the Cesium library, such as
// cesiumPath: '/statics/Cesium'
// use online reference for http
// cesiumPath: 'http://support.supermap.com.cn:8090/webgl/Build'
// use online reference for https
cesiumPath: 'https://zouyaoji.top/vue-cesium'
})
<template>
<div class="content">
<cesium-viewer>
</cesium-viewer>
</div>
</template>
<style>
.content {
background-color: #f9f9f9;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
Copyright (c) 2018-present, zouyaoji 370681295@qq.com
I referenced a lot from the vue-baidu-map project. Thanks very much!