-
-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After 0.31.1, problems caused by type having to be placed in the head #943
Comments
Eventually, I had to re-type the function in the corresponding file. <script lang="ts">
export interface ModalExpose {
changeLoading: (loading: boolean) => void
}
</script>
<script lang="ts" setup>
...
<script> I'm not sure there's a better way. |
From what I can tell, while this did change recently in vue-tsc, I believe it is intentional with the current script setup design. Any additional named exports are supposed to be in an additional <script> tag, so it makes sense that type-only exports would be included in that rule. See related issues:
I just added some changes to the vue 3 docs that explicitly call this out, although I'd love some more confirmation from the vue core team that this is correct and desired going forward. Not really so bad once you know... Although automatically hoisting things and just working would definitely be better. It also still leaves some weird edge cases where you need things exported that involve other things that are not, but need to be available in the template. 🤷 |
Thanks for your reply. |
As I mentioned in #901, although the editor no longer reported an error at that time, I did not test the packaging, now I test the packaging and found the packaging error, the problem is the same as the last issue, I used
vite + vue-tsc
.Attach an error log:
The text was updated successfully, but these errors were encountered: