vue如何将图片压缩成webp格式并用webpack打包
一.vue-cli将图片转化成webp格式1.安装vue-webp-pluginnpm install --save vue-webp-plugin2.配置webp-plugin(在main.js中插入下面代码)import WebpPlugun from 'vue-webp-plugin';Vue.use(WebpPlugun);3.使用方法:方法1:url可以为数组配合v-for使用,但是不能为数组单独使用<img v-webp="url"/><script>
原创
2021-01-13 15:30:18 ·
3954 阅读 ·
3 评论