You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/api/sfc-script-setup.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ Think of `MyComponent` as being referenced as a variable. If you have used JSX,
89
89
90
90
### Dynamic Components
91
91
92
-
Since components are referenced as variables instead of registered under string keys, we should use dynamic `:is` binding when using dynamic components inside `<script setup>`:
92
+
Since components are referenced as variables instead of registered under string keys, you should use dynamic `:is` binding when using dynamic components inside `<script setup>`:
93
93
94
94
```vue
95
95
<script setup>
@@ -133,7 +133,7 @@ import * as Form from './form-components'
133
133
134
134
## `defineProps` and `defineEmits`
135
135
136
-
To declare options like `props` and `emits`with full type inference support, we can use the `defineProps` and `defineEmits` APIs, which are automatically available inside `<script setup>`:
136
+
To declare `props` and `emits`in `<script setup>`, you must use the `defineProps` and `defineEmits` APIs, which provide full type inference support and are automatically available inside `<script setup>`:
-`defineProps` and `defineEmits` are **compiler macros** only usable inside `<script setup>`. They do not need to be imported, and are compiled away when `<script setup>` is processed.
150
150
151
-
-`defineProps` accepts the same value as the `props` option, while `defineEmits` accepts the same value as the `emits` option.
151
+
-`defineProps` accepts the same value as the [`props` option](/api/options-data.html#props), while `defineEmits` accepts the same value as the [`emits` option](/api/options-data.html#emits).
152
152
153
153
-`defineProps` and `defineEmits` provide proper type inference based on the options passed.
154
154
@@ -195,7 +195,7 @@ const attrs = useAttrs()
195
195
196
196
## Usage alongside normal `<script>`
197
197
198
-
`<script setup>` can be used alongside normal `<script>`. A normal `<script>` may be needed in cases where we need to:
198
+
`<script setup>` can be used alongside normal `<script>`. A normal `<script>` may be needed in cases where you need to:
199
199
200
200
- Declare options that cannot be expressed in `<script setup>`, for example `inheritAttrs` or custom options enabled via plugins.
0 commit comments