From c71ea4c6bc595a0efebb54feae7c3d56468748c3 Mon Sep 17 00:00:00 2001 From: Guyi Date: Mon, 22 Nov 2021 20:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=20KERNEL-8279=20=20feat=EF=BC=9A=E5=B5=8C?= =?UTF-8?q?=E5=A5=97=E8=B7=AF=E7=94=B1=E5=8F=AF=E4=BB=A5=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E5=88=B0=E5=AD=90=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/app.js | 26 ++++++++++++++------------ dist/router.js | 3 +++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/demo/app.js b/demo/app.js index 5bc38b985..5fd4f30c3 100644 --- a/demo/app.js +++ b/demo/app.js @@ -40,7 +40,7 @@ BI.$(function () { height: 100 }, { type: "bi.router_view", - name: 'home', + name: 'tool-buttons', deps: 1 }] }); @@ -49,12 +49,6 @@ BI.$(function () { path: '', components: { default: function () { - return Promise.resolve({ - type: "bi.label", - text: 'default' - }); - }, - home: function () { return Promise.resolve({ type: "bi.label", text: 'home' @@ -73,11 +67,19 @@ BI.$(function () { }, { name: 'tables', path: 'tables/:id', - component: function () { - return Promise.resolve({ - type: "bi.label", - text: 'tables' - }); + components: { + default: function () { + return Promise.resolve({ + type: "bi.label", + text: 'table-view' + }); + }, + "tool-buttons": function () { + return Promise.resolve({ + type: "bi.label", + text: '预览按钮', + }); + }, } }] }]; diff --git a/dist/router.js b/dist/router.js index 77ca04c7c..93a661d84 100644 --- a/dist/router.js +++ b/dist/router.js @@ -3147,6 +3147,7 @@ BI.RouterView = BI.inherit(BI.Widget, { props: { + baseCls: 'bi-router-view', deps: 0, name: 'default' }, @@ -3168,6 +3169,8 @@ self.tab.setSelect(matchedPath || "/"); } }); + // "bi.router_view"是由"bi.tab"实现的,cardCreator是一个异步过程,在"bi.router_view"创建之前,cbs里不会有创建子组件的方法,在初始化路由时,没法直接渲染到子组件,所以这里手动加了一次调用 + this._callbackListener(); }, render: function () { var self = this, o = this.options;