export default {
name: 'Viewer',
components: {
},
data: function () {
return {
styleObject: {
width: '100%',
position: 'absolute',
top: '0px',
bottom: '0px',
left: '0px',
backgroundColor: '#000000'
}
}
},
mounted: function () {
window.$viewer = new Cesium.Viewer('cesiumContainer',{
infoBox:true,
timeline:false
}) //给data中viewer赋值
window.$promise = window.$viewer.scene.open("http://localhost:8090/iserver/services/3D-pz/rest/realspace");
$(".cesium-widget-credits")[0].style.visibility = "hidden";
$(".cesium-viewer-navigationContainer")[0].style.visibility = "hidden";
}
}
将上面的代码单独做成一个vue组件