Skip to content

Commit 695e58b

Browse files
authored
fix(card): [card] fix card type definition error (#3088)
* fix: typo * fix(card): fix card type definition error * chore(dependencies): update vitest and @vitest/ui versions to v3 * Revert "chore(dependencies): update vitest and @vitest/ui versions to v3" This reverts commit c78329b.
1 parent 8839c6c commit 695e58b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

examples/sites/demos/apis/card.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ export default {
6868
},
6969
{
7070
name: 'type',
71-
type: 'string',
71+
type: '"text" | "image" | "video" | "logo"',
7272
defaultValue: 'text',
7373
desc: {
74-
'zh-CN': '设置卡片类型,支持 text、image、video、logo 4 种类型',
75-
'en-US': 'Set the card type. The options are text, image, video, and logo.'
74+
'zh-CN': '设置卡片类型',
75+
'en-US': 'Set the card type.'
7676
},
7777
mode: ['pc', 'mobile-first'],
7878
pcDemo: 'card-type',
7979
mfDemo: 'card-type'
80-
// 以下IPI暂不暴露
80+
// 以下API暂不暴露
8181
// {
8282
// name: 'check-type',
8383
// type: 'string',

packages/vue/src/card/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export const cardProps = {
5858
},
5959
type: {
6060
type: String,
61-
default: 'text'
61+
default: 'text',
62+
validator: (value: string) => ['text', 'image', 'video', 'logo'].includes(value)
6263
},
6364
disabled: {
6465
type: Boolean,

0 commit comments

Comments
 (0)