feat: lazy-load change and readme change

This commit is contained in:
水墨
2020-06-23 11:32:08 +08:00
committed by neverland
parent 232c3387cc
commit d02e4ae956
6 changed files with 32 additions and 45 deletions
+7 -3
View File
@@ -14,6 +14,7 @@ export default createComponent({
default: () => [],
},
isShowBigPicture: Boolean,
lazyLoad: Boolean,
},
computed: {
@@ -66,9 +67,12 @@ export default createComponent({
onClick={this.onPreviewImg}
/>
)}
{imgUrl && (
<img class={`${BEM_NAME}-img`} src={imgUrl} v-lazy={imgUrl} />
)}
{imgUrl &&
(this.isShowBigPicture && this.lazyLoad ? (
<img class={`${BEM_NAME}-img`} src={imgUrl} vLazy={imgUrl} />
) : (
<img class={`${BEM_NAME}-img`} src={imgUrl} />
))}
<span class={`${BEM_NAME}-name`}>{this.skuValue.name}</span>
</span>
);