/*! For license information please see 6635.df47c50a.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["6635"],{77186:function(t,n,s){"use strict";s.r(n);var a=s("80681");let d=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,a.wg)(),(0,a.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

Card

\n

Intro

\n

Used to display product pictures, prices and other information.

\n

Install

\n

Register component globally via app.use, refer to Component Registration for more registration ways.

\n
import { createApp } from 'vue';\nimport { Card } from 'vant';\n\nconst app = createApp();\napp.use(Card);\n
\n

Usage

\n

Basic Usage

\n
<van-card\n  num="2"\n  price="2.00"\n  title="Title"\n  desc="Description"\n  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"\n/>\n
\n

Discount Info

\n
<van-card\n  num="2"\n  tag="Tag"\n  price="2.00"\n  title="Title"\n  desc="Description"\n  origin-price="10.00"\n  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"\n/>\n
\n

Custom Content

\n

Use slot to custom content.

\n
<van-card\n  num="2"\n  title="Title"\n  desc="Description"\n  price="2.00"\n  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"\n>\n  <template #tags>\n    <van-tag plain type="primary">Tag</van-tag>\n    <van-tag plain type="primary">Tag</van-tag>\n  </template>\n  <template #footer>\n    <van-button size="mini">Button</van-button>\n    <van-button size="mini">Button</van-button>\n  </template>\n</van-card>\n
\n

API

\n

Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
AttributeDescriptionTypeDefault
thumbLeft thumb image URLstring-
titleTitlestring-
descDescriptionstring-
tagTagstring-
numnumbernumber | string-
pricePricenumber | string-
origin-priceOrigin pricenumber | string-
centeredWhether content vertical centeredbooleanfalse
currencyCurrency symbolstring\xa5
thumb-linkThumb link URLstring-
lazy-loadWhether to enable thumb lazy load, should register Lazyload componentbooleanfalse
\n

Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
EventDescriptionArguments
clickEmitted when component is clickedevent: MouseEvent
click-thumbEmitted when thumb is clickedevent: MouseEvent
\n

Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
NameDescription
titleCustom title
descCustom description
numCustom num
priceCustom price
origin-priceCustom origin price
price-topCustom price top
bottomCustom price bottom
thumbCustom thumb
tagCustom thumb tag
tagsCustom tags
footerCustom footer
\n

Types

\n

The component exports the following type definitions:

\n
import type { CardProps } from 'vant';\n
\n

Theming

\n

CSS Variables

\n

The component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
NameDefault ValueDescription
--van-card-paddingvar(--van-padding-xs) var(--van-padding-md)-
--van-card-font-sizevar(--van-font-size-sm)-
--van-card-text-colorvar(--van-text-color)-
--van-card-backgroundvar(--van-background)-
--van-card-thumb-size88px-
--van-card-thumb-radiusvar(--van-radius-lg)-
--van-card-title-line-height16px-
--van-card-desc-colorvar(--van-text-color-2)-
--van-card-desc-line-heightvar(--van-line-height-md)-
--van-card-price-colorvar(--van-text-color)-
--van-card-origin-price-colorvar(--van-text-color-2)-
--van-card-num-colorvar(--van-text-color-2)-
--van-card-origin-price-font-sizevar(--van-font-size-xs)-
--van-card-price-font-sizevar(--van-font-size-sm)-
--van-card-price-integer-font-sizevar(--van-font-size-lg)-
--van-card-price-fontvar(--van-price-font)-
\n
'},null,8,d))}}}]);