vuejs / docs

📄 Documentation for Vue 3
https://vuejs.org
Other
2.89k stars 4.31k forks source link

docs(sfc-script-setup): `<script setup>` cannot contain ES module exports #2532

Open dargmuesli opened 11 months ago

dargmuesli commented 11 months ago

Commit https://github.com/vuejs/docs/commit/7ab399147c15abf232064ebf701552f07e00f638 fixed issue #1678 by introducing an export to the interface Props. This export clashes with a specification in the same file, I think, which states:

A normal <script> may be needed in cases where we need to: [...] Declaring named exports.

This can seemingly lead to a new issue with [plugin:vite:vue] [@vue/compiler-sfc]: <script setup> cannot contain ES module exports. If you are using a previous version of <script setup>, please consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.

What's the proper way to resolve this issue? What am I missing?

dargmuesli commented 2 months ago

Hey @NataliaTepluhina, the commit I mentioned above is by you, so maybe you can assist to resolve this issue? :pray: