chore(Card): use tsx (#8067)

This commit is contained in:
neverland 2021-02-03 10:38:53 +08:00 committed by GitHub
parent 3712dac079
commit 25966bcf51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,9 +66,9 @@ export default createComponent({
return ( return (
<Image <Image
src={props.thumb} src={props.thumb}
fit="cover"
width="100%" width="100%"
height="100%" height="100%"
fit="cover"
lazyLoad={props.lazyLoad} lazyLoad={props.lazyLoad}
/> />
); );
@ -95,14 +95,13 @@ export default createComponent({
if (slots.desc) { if (slots.desc) {
return slots.desc(); return slots.desc();
} }
if (props.desc) { if (props.desc) {
return <div class={[bem('desc'), 'van-ellipsis']}>{props.desc}</div>; return <div class={[bem('desc'), 'van-ellipsis']}>{props.desc}</div>;
} }
}; };
const renderPriceText = () => { const renderPriceText = () => {
const priceArr = props.price.toString().split('.'); const priceArr = props.price!.toString().split('.');
return ( return (
<div> <div>
<span class={bem('price-currency')}>{props.currency}</span> <span class={bem('price-currency')}>{props.currency}</span>