diff --git a/changelog.md b/changelog.md index d0dbaf2c1..fa5fcd40f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-05) +- 修复调用BI.history.navigate(XXX, {trigger: false})时, XXX包含中文空格等字符仍然触发回调的问题 - 新增BI.after和BI.before方法 - 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题 - 填加bi-user-select-enable和bi-user-select-disable通用类名 diff --git a/src/router/router.js b/src/router/router.js index 2e7e9cbb2..5ca13eda5 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -490,7 +490,12 @@ // calls `loadUrl`, normalizing across the hidden iframe. checkUrl: function (e) { var current = this.getFragment(); - + try { + // getFragment 得到的值是编码过的,而this.fragment是没有编码过的 + // 英文路径没有问题,遇上中文和空格有问题了 + current = decodeURIComponent(current); + } catch { + } // If the user pressed the back button, the iframe's hash will have // changed and we should use that for comparison. if (current === this.fragment && this.iframe) {