在Vue2时我们经常会这样引用图片: ```vue ``` 但在Vite中不支持require了,引用图片变成了下面这样: ```vue ``` 每次使用图片都得import,显然耽误了大家摸鱼的时间,这时我们可以借助vite-plugin-vue-images来实现自动导入图片。 安装 ```ba
vite-plugin-vue-images Auto import images for Vite+Vue projects Warning This project is not currently maintained, but PRs are welcome. The version of Vite used is 2, and there are open issues which may affect usage. Usage Only works with Vite 2 & Vue 3. ...
Auto import images for Vite+Vue projects. Contribute to sampullman/vite-plugin-vue-images development by creating an account on GitHub.
vite.config.ts importViteImagesfrom'vite-plugin-vue-images'plugins:[ViteImages({dirs:['src/assets/images'],// 指明图片存放目录extensions:['jpg','jpeg','png','svg','webp'],// 有效的图像扩展customResolvers:[],// 覆盖名称->图像路径解析的默认行为customSearchRegex:'([a-zA-Z0-9]+)'//...
Auto import images for Vite+Vue projects. Contribute to sampullman/vite-plugin-vue-images development by creating an account on GitHub.
配置ViteImages 打包提示img src的变量不存在 版本为 "vite-plugin-vue-images": "^0.6.1", vite 版本为2.8.3 Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment Assignees No one assigned Labels ...
> [!WARNING] > This project is not currently maintained, but PRs are welcome. The version of Vite used is 2, and there are open issues which may affect usage. ## Usage > **Only works with Vite 2 & Vue 3.** 0 comments on commit 4da4402 Please sign in to comment. Footer ...