merge lll-fix-nodata-img into master
修复nodata组件img问题 Created-by: LovableCat Commit-by: LovableCat Merged-by: LovableCat Description: 修复nodata组件img问题 See merge request: hk_openRepo/OpenRepo_Portal!29
This commit is contained in:
@@ -2,10 +2,24 @@
|
|||||||
<div class="bg-white w-full flex flex-col items-center py-[20px]">
|
<div class="bg-white w-full flex flex-col items-center py-[20px]">
|
||||||
<slot name="img">
|
<slot name="img">
|
||||||
<img
|
<img
|
||||||
v-if="!hideImg"
|
v-if="!hideImg && imgSrc"
|
||||||
class="block mb-[20px]"
|
class="block mb-[20px]"
|
||||||
:width="imgWidth"
|
:width="imgWidth"
|
||||||
:src="src"
|
:src="imgSrc"
|
||||||
|
alt="NoData"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-if="!hideImg && !small"
|
||||||
|
class="block mb-[20px]"
|
||||||
|
:width="imgWidth"
|
||||||
|
src="/src/assets/imgs/jyh/nodata.svg"
|
||||||
|
alt="NoData"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-if="!hideImg && small"
|
||||||
|
class="block mb-[20px]"
|
||||||
|
:width="imgWidth"
|
||||||
|
src="/src/assets/imgs/jyh/nodata_small.svg"
|
||||||
alt="NoData"
|
alt="NoData"
|
||||||
/>
|
/>
|
||||||
</slot>
|
</slot>
|
||||||
@@ -36,12 +50,6 @@ const props = defineProps({
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const src = computed(() => {
|
|
||||||
if (props.imgSrc) {
|
|
||||||
return props.imgSrc;
|
|
||||||
}
|
|
||||||
return props.small ? '/src/assets/imgs/jyh/nodata_small.svg' : '/src/assets/imgs/jyh/nodata.svg';
|
|
||||||
});
|
|
||||||
const imgWidth = computed(() => {
|
const imgWidth = computed(() => {
|
||||||
if (props.width) {
|
if (props.width) {
|
||||||
return props.width;
|
return props.width;
|
||||||
|
|||||||
Reference in New Issue
Block a user