vue3 中引入图片
- 在 webpack 中
const img = require('@/views/pages/threejs/assets/images/bg.jpeg')
- 在 vite 中
const img = new URL('@/views/pages/threejs/assets/images/bg.jpeg',import.meta.url).href
const img = require('@/views/pages/threejs/assets/images/bg.jpeg')
const img = new URL('@/views/pages/threejs/assets/images/bg.jpeg',import.meta.url).href