Subscribe on changes!

Can't get expose data type from child component when use script setup and typescript

avatar
Oct 28th 2021

Version

3.2.16

Reproduction link

github.com

Steps to reproduce

I have two question:

  1. I can't get expose data hint when use typescript
const handleNameChange = () => {
  count.value = Math.random();
  console.log(TestComponentRef.value?.title); // can't get expose data hint
};
  1. I must to write:
<script lang="ts">
export default {};
</script>

if not add that, when import TestComponent from "./components/TestComponent.vue", will get error: '... not export the default' error

What is expected?

Get the right hint.

What is actually happening?

Get error.

avatar
Oct 28th 2021

Duplicate of #4397