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
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -239,6 +239,13 @@ export default {
239
239
</script>
240
240
```
241
241
242
+
Support for combining `<script setup>` and `<script>` in the same component is limited to the scenarios described above. Specifically:
243
+
244
+
- Do **NOT** use a separate `<script>` section for options that can already be defined using `<script setup>`, such as `props` and `emits`.
245
+
- Variables created inside `<script setup>` are not added as properties to the component instance, making them inaccessible from the Options API. Mixing APIs in this way is strongly discouraged.
246
+
247
+
If you find yourself in one of the scenarios that is not supported then you should consider switching to an explicit [`setup()`](/api/composition-api-setup.html) function, instead of using `<script setup>`.
248
+
242
249
## Top-level `await` {#top-level-await}
243
250
244
251
Top-level `await` can be used inside `<script setup>`. The resulting code will be compiled as `async setup()`:
0 commit comments