ElemeFE / ElemeFE/element

message切换路由后无法被关闭 莫名其妙出现的bug

Open
#22,079 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

nuxt项目 目前无法重现 因为是已上线项目 下午将echarts改为cdn形式引入 (也或许是其他原因导致的,只是下午发现了,但线上项目正常)后又尝试将element按官网教程改为按需引入后出现的该bug ,但是恢复element的全部引入仍然不行 因为不明白是那块的问题 所以排除了很久都没找到原因

出现的情况就是 在切换路由后 已显示的消息弹窗将会一直显示 除非刷新页面

在未切换路由时设置的自动关闭duration可以正常关闭 showClose: true,通过点击×也可正常关闭 但 在切换了路由后设置的自动关闭duration不会生效 showClose: true,通过点击×也无法关闭

通过`window.$msg = this.$message({ showClose: true, message: 'error', type: 'error', duration: 4000 });`

在切换路由后 通过打印$msg.closed 属性值 该值 在4秒内为false 4秒后为true 但为true时 弹窗依旧显示 且调用$msg.close()无法关闭消息弹窗 返回值为undefined

nuxt build配置
`{ transpile: [/^element-ui/], babel: { plugins: [ ['component', { libraryName: 'element-ui', styleLibraryName: 'theme-chalk' } ] ] }, }`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.