Browse Source

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

* commit 'fe411b5b855e53aea03f0ea7f8374a4a86d8e3d8':
  无jira 类型
  无JIRA tab的showIndex 响应式也支持false的时候不进行创建
es6
superman 3 years ago
parent
commit
7e5cafa31d
  1. 11
      src/base/combination/tab.js
  2. 15
      typescript/core/widget.ts

11
src/base/combination/tab.js

@ -86,15 +86,18 @@ BI.Tab = BI.inherit(BI.Widget, {
created: function () { created: function () {
var self = this, o = this.options; var self = this, o = this.options;
if (o.showIndex !== false) {
var showIndex;
if (BI.isFunction(o.showIndex)) { if (BI.isFunction(o.showIndex)) {
var v = this.__watch(o.showIndex, function (context, newValue) { showIndex = this.__watch(o.showIndex, function (context, newValue) {
self.setSelect(newValue); self.setSelect(newValue);
}); });
this.setSelect(v);
} else { } else {
this.setSelect(o.showIndex); showIndex = o.showIndex;
} }
if (showIndex !== false) {
this.setSelect(showIndex);
} }
}, },

15
typescript/core/widget.ts

@ -42,8 +42,8 @@ export interface _Widget extends _OB {
element: { element: {
width(): number; width(): number;
height(): number; height(): number;
width(width: number | string): _Widget['element']; width(width: number | string): _Widget["element"];
height(height: number | string): _Widget['element']; height(height: number | string): _Widget["element"];
[key: string]: any; [key: string]: any;
}; };
@ -110,7 +110,7 @@ export interface _Widget extends _OB {
/** /**
* *
*/ */
shouldUpdate?(): void; shouldUpdate?(...args: any[]): void;
/** /**
* *
@ -449,8 +449,8 @@ export declare class Widget extends OB {
element: { element: {
width(): number; width(): number;
height(): number; height(): number;
width(width: number | string): Widget['element']; width(width: number | string): Widget["element"];
height(height: number | string): Widget['element']; height(height: number | string): Widget["element"];
[key: string]: any; [key: string]: any;
}; };
@ -783,6 +783,11 @@ export declare class Widget extends OB {
*/ */
_unMount(): void; _unMount(): void;
/**
* watch响应式数据
*/
__watch<T extends (...args: any) => any>(getter: T, handler: Function, options?: Obj): ReturnType<T>
/** /**
* hang元素 * hang元素
*/ */

Loading…
Cancel
Save