when i migrate my project from vue-cli to vite, i meet an unexpected problem!
vue component cannot be loaded correctly when data have some specific name
code is below:
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
when i migrate my project from vue-cli to vite, i meet an unexpected problem! vue component cannot be loaded correctly when data have some specific name code is below:
created
method will not run. if delete the lineexportType = 'xlsx';
or thegetter
method, this component will run correctlyI guess its a bug of the compiler. It reads the 'export', 'default' word and do something wrong.
Need your help!
将项目从VueCLI迁移到Vite时遇到了问题。代码如上文。当Vue组件有一个数据叫
exportType
,一个getter中包含叫default
的取值时,这个组件无法正常运行,created
方法不执行。把exportType = 'xlsx';
那行或者getter
删掉就正常了。 猜测是编译器把export
和default
读到了一起,然后编译错了东西? 需要你的帮助!Reproduction
https://stackblitz.com/edit/vitejs-vite-s1r7wy?file=src%2Fcomponents%2FExportIssues.vue
Steps to reproduce
No response
System Info
Used Package Manager
yarn
Logs
No response
Validations