import { use, isDef } from '../utils';
import Tag from '../tag';
const [sfc, bem] = use('card');
export default sfc({
props: {
tag: String,
desc: String,
thumb: String,
title: String,
centered: Boolean,
lazyLoad: Boolean,
thumbLink: String,
num: [Number, String],
price: [Number, String],
originPrice: [Number, String],
currency: {
type: String,
default: '¥'
}
},
render(h) {
const { thumb, slots } = this;
const showThumb = slots('thumb') || thumb;
const showTag = slots('tag') || this.tag;
const showNum = slots('num') || isDef(this.num);
const showPrice = slots('price') || isDef(this.price);
const showOriginPrice = slots('origin-price') || isDef(this.originPrice);
const Thumb = showThumb && (
{slots('thumb') ||
(this.lazyLoad ? (
) : (
))}
{showTag && (