代码是这样
setup(){
const store = useStore()
let sidebar = reactive({
maplocate:{
name: '图层管理',
visible: false,
},
searchtool:{
name: '搜索工具',
visible: false,
}
})
onMounted(()=>{
const stores = useStore()
const layers=[]
var viewer = new Cesium.Viewer('cesiumContainer',{})
var cloudSkyBox = new Cesium.SkyBox({
sources: {
positiveX: "@/assets/rightav9.jpg",
negativeX: "@/assets/leftav9.jpg",
positiveY: "@/assets/frontav9.jpg",
negativeY: "@/assets/backav9.jpg",
positiveZ: "@/assets/topav9.jpg",
negativeZ: "@/assets/bottomav9.jpg",
}
});
stores.state.items=viewer
let scene = viewer.scene;
scene.skyBox = cloudSkyBox;
})
return{
sidebar
}
}
}
到了界面是这样