Commit 5996e15e authored by 王玉鑫's avatar 王玉鑫

feat: 图片质量参数修改

parent f6007ee3
<!-- 图片展示,方便修改占位图、错误图 --> <!-- 图片展示,方便修改占位图、错误图 -->
<template> <template>
<ElImage :src="src" @click="handleClick"> <ElImage :src="formatedSrc" @click="handleClick">
<template #placeholder> <template #placeholder>
<img class="h-full w-full" :src="currentdefault" @click="handleClick" /> <img class="h-full w-full" :src="currentdefault" @click="handleClick" />
</template> </template>
...@@ -45,6 +45,15 @@ const currentdefault = computed(() => { ...@@ -45,6 +45,15 @@ const currentdefault = computed(() => {
return props.type ? config[props.type] : defaultPicIcon; return props.type ? config[props.type] : defaultPicIcon;
}); });
const formatedSrc = computed(() => {
const { src } = props;
if (src) {
return `${src}?x-image-process=style/style-a460`;
} else {
return src;
}
});
const handleClick = () => { const handleClick = () => {
emit('click'); emit('click');
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment