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

在vue3+vite+ts项目中使用按需引入方法使用element-plus 在页面使用el-button组件该页面渲染无数次 #793

Open
5 tasks done
zj261788 opened this issue Aug 15, 2024 · 0 comments

Comments

@zj261788
Copy link

Describe the bug

项目版本: "vite": "^5.3.5", "unplugin-vue-components": "^0.27.4", "element-plus": "^2.8.0",
vite.config.ts中的配置如下
/* 自动按需引入 /
AutoImport({
/
自动导入 Vue 相关函数,如:ref, reactive, toRef 等 /
imports: ["vue", "vue-router", "pinia"],
/
自动导入element相关函数,如:ElMessage, ElMessageBox.. /
resolvers: [ElementPlusResolver()]
}),
Components({
/
自动导入element相关组件 */
resolvers: [ElementPlusResolver()]
})
vue页面代码如下

Default
<script setup lang="ts"> alert(1); </script>

结果该页面alert执行无数次,直到页面崩溃

Reproduction

bug

System Info

谷歌浏览器

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant