ElemeFE / ElemeFE/element

[bug report] closeonhashchange parameter update problem

Open
#19,693 2 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.13.0

### OS/Browsers version
window 10 / chrome 81

### Vue version
2.6.11

### Reproduction Link
https://codepen.io/tengmaoqing/pen/LYGWYwq?editors=1111

### Steps to reproduce
可以看到先点击按钮1和先点击按钮2.
按钮2 配置了 closeOnHashChange: false,与期望不一致

### What is Expected?
不同 $confirm方法的closeOnHashChange 都能生效,应该与配置一致

### What is actually happening?
所有$confirm 的 closeOnHashChange 行为都只使用了第一个$confirm的配置。
因为 $confirm 始终使用的是一个 message-box 组件instance,而 closeOnHashChange控制的 hashChange 事件只在mounted中添加,beforeDestroy 中移除。导致了所有$confirm、$alert的closeOnHashChange 配置只有第一个执行的弹窗生效

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.