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

Appearance settings

Commit fdb67d1

Browse filesBrowse files
authored
docs: better example to clarify rule (#1984)
1 parent a4e807c commit fdb67d1
Copy full SHA for fdb67d1

File tree

1 file changed

+8
-4
lines changed
Filter options

1 file changed

+8
-4
lines changed

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

Copy file name to clipboardExpand all lines: docs/rules/define-props-declaration.md
+8-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.