Browse Source

Merge pull request #57662 in DEC/fineui from master to feature/x

* commit '653e6b20b5ea4f18ecbae7c48a4a809e69592fa0':
  无jira任务,多提交了
  Revert "无JIRA任务 路由问题"
es6
superman 3 years ago
parent
commit
ae4faee977
  1. 7
      src/router/router.js

7
src/router/router.js

@ -3156,9 +3156,7 @@
},
created: function () {
var self = this, o = this.options;
// 嵌套路由 + single 下父亲执行setSelect后会执行一遍push + _callbackListener,之后在cbs.forEach下会执行到刚push进去的_callbackListener导致执行两次,这里加一个nextTick让forEach走不到新push进去的方法。
BI.nextTick(function () {
cbs.push(self._callbackListener = function () {
cbs.push(this._callbackListener = function () {
var current = $router.history.current;
// 匹配的路径名(/component/:id)
var matchedPath = current.matched[o.deps] && current.matched[o.deps].path;
@ -3175,8 +3173,7 @@
}
});
// "bi.router_view"是由"bi.tab"实现的,cardCreator是一个异步过程,在"bi.router_view"创建之前,cbs里不会有创建子组件的方法,在初始化路由时,没法直接渲染到子组件,所以这里手动加了一次调用
self._callbackListener();
});
this._callbackListener();
},
render: function () {
var self = this, o = this.options;

Loading…
Cancel
Save