Vue.component("http-webp-config-box", { props: ["v-webp-config", "v-is-location", "v-is-group", "v-require-cache"], data: function () { let config = this.vWebpConfig if (config == null) { config = { isPrior: false, isOn: false, minLength: {count: 0, "unit": "kb"}, maxLength: {count: 0, "unit": "kb"}, mimeTypes: ["image/png", "image/jpeg", "image/bmp", "image/x-ico"], extensions: [".png", ".jpeg", ".jpg", ".bmp", ".ico"], conds: null } } if (config.mimeTypes == null) { config.mimeTypes = [] } if (config.extensions == null) { config.extensions = [] } return { config: config, moreOptionsVisible: false } }, methods: { isOn: function () { return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn }, changeExtensions: function (values) { values.forEach(function (v, k) { if (v.length > 0 && v[0] != ".") { values[k] = "." + v } }) this.config.extensions = values }, changeMimeTypes: function (values) { this.config.mimeTypes = values }, changeAdvancedVisible: function () { this.moreOptionsVisible = !this.moreOptionsVisible }, changeConds: function (conds) { this.config.conds = conds } }, template: `
启用WebP压缩

选中后表示开启自动WebP压缩;图片的宽和高均不能超过16383像素;只有满足缓存条件的图片内容才会被转换

支持的扩展名

含有这些扩展名的URL将会被转成WebP,不区分大小写。

支持的MimeType

响应的Content-Type里包含这些MimeType的内容将会被转成WebP。

内容最小长度

0表示不限制,内容长度从文件尺寸或Content-Length中获取。

内容最大长度

0表示不限制,内容长度从文件尺寸或Content-Length中获取。

匹配条件
` })