vant/packages/card/index.vue
neverland ffa3fddfae
[bugfix] remove unnecessary props (#323)
* fix: Tabbar icon line-height

* [new feature] progress add showPivot prop

* [new feature] TabItem support vue-router

* [new feature] update document header style

* [Doc] add toast english ducoment

* [bugfix] Search box-sizing wrong

* [Doc] update vant-demo respo

* [Doc] translate theme & demo pages

* [Doc] add Internationalization document

* [bugfix] remove unnecessary props
2017-11-16 03:12:13 -06:00

43 lines
1.2 KiB
Vue

<template>
<div :class="['van-card', { 'van-card--center': centered }]">
<div class="van-card__thumb">
<slot name="thumb">
<img :src="thumb" class="van-card__img" />
</slot>
</div>
<div class="van-card__content">
<slot name="title">
<div class="van-card__row" v-if="title || price !== undefined">
<div v-if="title" class="van-card__title">{{ title }}</div>
<div v-if="price !== undefined" class="van-card__price">¥ {{ price }}</div>
</div>
</slot>
<slot name="desc">
<div class="van-card__row" v-if="desc || num !== undefined">
<div v-if="desc" class="van-card__desc">{{ desc }}</div>
<div v-if="num !== undefined" class="van-card__num">x {{ num }}</div>
</div>
</slot>
<slot name="tags"></slot>
</div>
<div class="van-card__footer" v-if="$slots.footer">
<slot name="footer"></slot>
</div>
</div>
</template>
<script>
export default {
name: 'van-card',
props: {
thumb: String,
title: String,
desc: String,
centered: Boolean,
num: [Number, String],
price: [Number, String]
}
};
</script>