Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fdb67d1

Browse files
docs: better example to clarify rule (#1984)
1 parent a4e807c commit fdb67d1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎docs/rules/define-props-declaration.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ This rule only works in setup script and `lang="ts"`.
2121
<script setup lang="ts">
2222
/* ✓ GOOD */
2323
const props = defineProps<{
24-
kind: string
24+
kind: string,
25+
options: { title: string }
2526
}>()
2627
2728
/* ✗ BAD */
2829
const props = defineProps({
29-
kind: { type: String }
30+
kind: { type: String },
31+
options: { type: Object as PropType<{ title: string }> }
3032
})
3133
</script>
3234
```
@@ -50,12 +52,14 @@ const props = defineProps({
5052
<script setup lang="ts">
5153
/* ✓ GOOD */
5254
const props = defineProps({
53-
kind: { type: String }
55+
kind: { type: String },
56+
options: { type: Object as PropType<{ title: string }> }
5457
})
5558
5659
/* ✗ BAD */
5760
const props = defineProps<{
58-
kind: string
61+
kind: string,
62+
options: { title: string }
5963
}>()
6064
</script>
6165
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /