mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* 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 * [fix] optimize clickoutside * [new feature] optimize find-parent * [new feature]: change document title accordinng to language * [new feature] Pagination code review * [improvement] adjust icon-font unicode * [improvement] Icon spinner color inherit * [improvement] icon default width * [bugfix] DateTimePicker validate date props * [bugfix] Tab item text ellipsis * [improvement] optimize single line ellipsis * [Improvement] optimzie staticClass
43 lines
1.2 KiB
Vue
43 lines
1.2 KiB
Vue
<template>
|
|
<div class="van-card" :class="{ '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>
|