I don't understand. You are writing TS in script tag. But I don't see you are using TS inside your setup function. You can write this without add typescript and just use setup(). So what is this blog about?
It is a very very simple example, it's true that I'm not using any specific Typescript code inside the setup function but I could have use it because the project is configured to transpile typescript.
This article was about configuring the environment to create a very easy component to try composition API through Typescript. It's clear that you can easily remove all the TS setup and go with the vanilla JS ;)
PS: if I had used only JS I would have defined a the component with export default { setup(){} } and not with export default defineComponent({ .. })
I don't understand. You are writing TS in script tag. But I don't see you are using TS inside your setup function. You can write this without add typescript and just use setup(). So what is this blog about?
It is a very very simple example, it's true that I'm not using any specific Typescript code inside the setup function but I could have use it because the project is configured to transpile typescript.
This article was about configuring the environment to create a very easy component to try composition API through Typescript. It's clear that you can easily remove all the TS setup and go with the vanilla JS ;)
PS: if I had used only JS I would have defined a the component with
export default { setup(){} }
and not withexport default defineComponent({ .. })
I see. Thank you for clearly that up for me. Good reading too.