Skip to content

Commit 5821a84

Browse files
github-actions[bot]heappyndwebfansplz
authored
feat(question): Prop Validation (#324)
* feat(question): Prop Validation Co-authored-by: Lov`u`e <105651386+heappynd@users.noreply.github.com> Co-authored-by: webfansplz <308241863@qq.com>
1 parent 8d810e1 commit 5821a84

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed

questions/323-prop-validation/App.vue

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script setup>
2+
import Button from "./Button.vue"
3+
</script>
4+
5+
<template>
6+
<Button/>
7+
</template>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script setup>
2+
defineProps({
3+
type: {},
4+
})
5+
</script>
6+
7+
<template>
8+
<button>Button</button>
9+
</template>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--info-header-start-->
2+
<!--info-header-end-->
3+
4+
5+
Please validate the `type` prop of the `Button` component. it's accept the following strings `primary | ghost | dashed | link | text | default` only and the default value is `default`.
6+
7+
8+
<!--info-footer-start-->
9+
<!--info-footer-end-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!--info-header-start-->
2+
<!--info-header-end-->
3+
4+
5+
请验证`Button`组件的`Prop`类型 ,使它只接收: `primary | ghost | dashed | link | text | default` ,且默认值为`default`
6+
7+
<!--info-footer-start-->
8+
<!--info-footer-end-->
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
difficulty: easy
2+
title: Prop Validation
3+
tags: Components
4+
author:
5+
github: heappynd
6+
name: Lov`u`e
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
difficulty: easy
2+
title: Prop验证
3+
tags: Components
4+
author:
5+
github: heappynd
6+
name: Lov`u`e
7+

0 commit comments

Comments
 (0)