解决方法
官网 https://vitejs.cn/guide/assets.html#the-public-directory
html
<div class="picfloat">
<img :src="oneNews.floatPic" alt="1">
</div>
javascript
import { reactive } from 'vue';
let oneNews = reactive({
floatPic: new URL('@/assets/home-cake3.jpg',import.meta.url).href,
})