Skip to content

<script lang="tsx" setup> The page has no hot updates But <script lang="tsx"> is ok  #5111

@wsw2000

Description

@wsw2000

Version

3.2.26

Reproduction link

sfc.vuejs.org/

Steps to reproduce

 I created the project with vite and installed @ vitejs / plugin Vue JSX and typescript, vue3 2.26. In < script lang = "TSX" setup >, create an array object with reactive two-way binding. Modify the ‘label’ field of the first object in the code and save the code. However, the web page is not hot updated and needs to be refreshed before it can be updated, but you can use < script lang = "TSX" >

Exports with definecomponent are hot updated. I don't know if there is a problem with my vite configuration or writing method
Woo woo woo~~

The codes that cannot be hot updated are as follows:

{{ columns[0].label }} <script lang="tsx" setup> import { reactive, defineComponent } from 'vue' const columns = reactive([ { prop: 'id', label: 'wsw', align: 'left', fixed: true, minWidth: 105, }, ]) </script> Code that can be hot updated: {{ columns[0].label }} <script lang="tsx"> import { reactive, defineComponent } from 'vue' export default defineComponent({ setup() { const columns = reactive([ { prop: 'id', label: 'wsw', align: 'left', fixed: true, minWidth: 105, }, ]) return { columns, } }, }) </script>

What is expected?

It is expected that the label of the array object is modified and the code is saved. The web page should be updated in real time, but < script lang = "TSX" setup > can't, < script lang = "TSX" > can

What is actually happening?

< script lang = "TSX" setup > can't hot update, < script lang = "TSX" > can hot update

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions