the page build with script setup does not respond to changes
Version
3.1.1
Reproduction link
https://codesandbox.io/s/bug-vue-script-tsx-4um6n?file=/src/views/todo-script-tsx.vue
Steps to reproduce
- current page show you is script-tsx, everything is correct,you can add one thing (at script-tsx page)
- click the link which is called tsx, the page is correct, it will list all you added, you can add one thing again (at tsx page)
- back to script-tsx ,the page will not list all things, when you add one ,it will not list at all (at script tsx page)
What is expected?
the script-tsx page can list all things i added when i back to this page
What is actually happening?
it will not list all things, and i can't add things any more
I'm a bit unsure what you are trying to achieve here.
<script setup>
is definitely not designed to export default a functional TSX component.
It's designed to work with a template. for the most part, it exists so you can have an authoring experience similar to that of a .tsx file - no need to register components etc.
I'm a bit unsure what you are trying to achieve here.
<script setup>
is definitely not designed to export default a functional TSX component.It's designed to work with a template. for the most part, it exists so you can have an authoring experience similar to that of a .tsx file - no need to register components etc.
I submit a discussion in rfcs,i think there should be no restrictions for tsx or template, it just as a simplified way to write setup function https://github.com/vuejs/rfcs/discussions/330