Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defineProps导致热更新失效 #10556

Closed
thikiiii opened this issue Mar 20, 2024 · 3 comments
Closed

defineProps导致热更新失效 #10556

thikiiii opened this issue Mar 20, 2024 · 3 comments

Comments

@thikiiii
Copy link

Vue version

3.4.21

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-rckp9s?file=package.json,src%2FApp.vue,src%2Ftype.ts&terminal=dev

Steps to reproduce

当 defineProps 使用泛型的时候,你在当前组件的任何操作都会导致热更新失败,必须的重启项目,去掉泛型一切都正常

What is expected?

热更新正常

What is actually happening?

System Info

No response

Any additional comments?

No response

@YiMo1
Copy link

YiMo1 commented Mar 20, 2024

我使用你给的示例试了下,发现 defineProps 函数使用泛型时热更新依旧正常,但如果使用了 ant-design-vue 组件中的 interface 作为类型传入,会导致热更新变得异常缓慢。单独使用 TableProps 时,就像这样 defineProps<TableProps >(),热更新时间大概是30秒,如果再加入Omit内置函数时,就像这样 defineProps<Omit<TableProps,'columns'>>(),热更新时间则会有几分钟。具体原因不明

@thikiiii
Copy link
Author

我用你给的例子试了一下,发现defineProps函数使用泛型时热更新仍然正常,但如果使用ant-design-vue组件中的接口作为类型确定,会导致热更新变得异常缓慢。使用TableProps时,就像这样 defineProps<TableProps >(),热更新时间大概是30秒,如果再加入省略内置函数时,就像这样 defineProps<Omit<TableProps,'columns'>>(),热更新时间有几个。具体原因不清楚

@vitejs/plugin-vue 这个插件的问题,把这个插件换成4.6.2版本就没这个问题了

@sodatea
Copy link
Member

sodatea commented Mar 29, 2024

Let's track this issue at vitejs/vite-plugin-vue#374

@sodatea sodatea closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants