0👍
vue files can’t compile to different code it doesn’t accept export
something out of file
maybe you are looking for something like defineExpose
Counter.vue
<template>
<button @click="counter++">count: {{ counter }}</button>
</template>
<script lang="ts" setup>
const counter = ref(0)
defineExpose({ counter })
</script>
App.vue
<template>
<Counter ref="counterRef" />
Count in Counter: {{ counterRef?.counter }}
</template>
<script lang="ts" setup>
const counterRef = ref<InstanceType<typeof Counter>>()
</script>
Source:stackexchange.com