vite+vue3批量引入图片

glob是懒加载的模式

let imageList = import.meta.glob("./assets/images/*.*");

globEager直接做静态加载

let imageList = import.meta.globEager("./assets/images/*.*");

let arr = object.values(imageList).map(v => v.default)

你可能感兴趣的:(vue.js入门,前端,javascript,vue.js)