在封装的函数内显示本地图片的时候,需要将图片import 进去,然后再去引入,否则会报错
例如:
import test
from '../assets/location.png'
export default {
mounted() {
viewer
.entities
.add({
position
: Cesium
.Cartesian3
.fromDegrees(110.20, 34.55, 2.61),
billboard
: {
image
: test
,
height
: 50,
width
: 50
}
})
}
}
转载请注明原文地址: https://lol.8miu.com/read-34952.html