diff --git a/example/pages/card/index.wxml b/example/pages/card/index.wxml index 9d28fdb9..33d0ed04 100644 --- a/example/pages/card/index.wxml +++ b/example/pages/card/index.wxml @@ -1,20 +1,21 @@
diff --git a/packages/card/README.md b/packages/card/README.md index 37dce330..25744bf9 100644 --- a/packages/card/README.md +++ b/packages/card/README.md @@ -15,10 +15,10 @@ ```html ``` @@ -28,10 +28,11 @@ ```html @@ -48,6 +49,7 @@ | thumb | 左侧图片 | `String` | - | | title | 标题 | `String` | - | | desc | 描述 | `String` | - | +| tag | 标签 | `String` | - | | num | 商品数量 | `String | Number` | - | | price | 商品价格 | `String | Number` | - | | centered | 内容是否垂直居中 | `String` | `false` | diff --git a/packages/card/index.json b/packages/card/index.json index 467ce294..e9174076 100644 --- a/packages/card/index.json +++ b/packages/card/index.json @@ -1,3 +1,6 @@ { - "component": true + "component": true, + "usingComponents": { + "van-tag": "../tag/index" + } } diff --git a/packages/card/index.less b/packages/card/index.less index c004854e..4883c804 100644 --- a/packages/card/index.less +++ b/packages/card/index.less @@ -77,6 +77,12 @@ font-size: 12px; } + &__tag { + position: absolute; + top: 2px; + left: 0; + } + &__footer { right: 15px; bottom: 5px; diff --git a/packages/card/index.ts b/packages/card/index.ts index ad517d83..39ca597b 100644 --- a/packages/card/index.ts +++ b/packages/card/index.ts @@ -10,6 +10,7 @@ VantComponent({ ], props: { + tag: String, num: String, desc: String, thumb: String, diff --git a/packages/card/index.wxml b/packages/card/index.wxml index ce82622b..0e0d6611 100644 --- a/packages/card/index.wxml +++ b/packages/card/index.wxml @@ -2,6 +2,14 @@ + + {{ tag }} +