@zhongguo168a/yxeditor-common 0.0.93 → 0.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +18 -17
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1283,6 +1283,21 @@ declare class ViewHistory extends RouteList {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
declare const viewhistorys: ViewHistory;
|
|
1285
1285
|
|
|
1286
|
+
declare class ViewModelComponent extends Component {
|
|
1287
|
+
/**
|
|
1288
|
+
* 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
|
|
1289
|
+
* @param node
|
|
1290
|
+
*/
|
|
1291
|
+
static tailNode(node: Node): ViewModel;
|
|
1292
|
+
protected onEnable(): void;
|
|
1293
|
+
protected onDisable(): void;
|
|
1294
|
+
setEnableHandler(value: () => void): this;
|
|
1295
|
+
setDisableHandler(value: () => void): this;
|
|
1296
|
+
viewModel: ViewModel;
|
|
1297
|
+
private _onEnable;
|
|
1298
|
+
private _onDisable;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1286
1301
|
declare class ViewModel extends EventDispatcher {
|
|
1287
1302
|
/**
|
|
1288
1303
|
* 视图模型的名称
|
|
@@ -1307,8 +1322,8 @@ declare class ViewModel extends EventDispatcher {
|
|
|
1307
1322
|
* @param controller
|
|
1308
1323
|
*/
|
|
1309
1324
|
useRoute(route: Route, controller: RouteController): void;
|
|
1310
|
-
open():
|
|
1311
|
-
close():
|
|
1325
|
+
open(): this;
|
|
1326
|
+
close(): this;
|
|
1312
1327
|
refresh(): void;
|
|
1313
1328
|
stop(reason?: LinkError): void;
|
|
1314
1329
|
/**
|
|
@@ -1338,6 +1353,7 @@ declare class ViewModel extends EventDispatcher {
|
|
|
1338
1353
|
protected _controller: RouteController;
|
|
1339
1354
|
protected _route: Route;
|
|
1340
1355
|
protected _reason: LinkError;
|
|
1356
|
+
protected _viewModelComponent: ViewModelComponent;
|
|
1341
1357
|
protected onOpen(): void;
|
|
1342
1358
|
protected onOpened(): void;
|
|
1343
1359
|
protected onClose(): void;
|
|
@@ -1387,21 +1403,6 @@ declare class RouteViewDict extends ViewDict {
|
|
|
1387
1403
|
}
|
|
1388
1404
|
declare const routeViews: RouteViewDict;
|
|
1389
1405
|
|
|
1390
|
-
declare class ViewModelComponent extends Component {
|
|
1391
|
-
/**
|
|
1392
|
-
* 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
|
|
1393
|
-
* @param node
|
|
1394
|
-
*/
|
|
1395
|
-
static tailNode(node: Node): ViewModel;
|
|
1396
|
-
protected onEnable(): void;
|
|
1397
|
-
protected onDisable(): void;
|
|
1398
|
-
setEnableHandler(value: () => void): this;
|
|
1399
|
-
setDisableHandler(value: () => void): this;
|
|
1400
|
-
viewModel: ViewModel;
|
|
1401
|
-
private _onEnable;
|
|
1402
|
-
private _onDisable;
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
1406
|
/**
|
|
1406
1407
|
* 事件字符串分隔符
|
|
1407
1408
|
*/
|
package/dist/index.esm.js
CHANGED
|
@@ -4277,6 +4277,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4277
4277
|
this.node = node;
|
|
4278
4278
|
let com = node.addComponent(ViewModelComponent);
|
|
4279
4279
|
com.viewModel = this;
|
|
4280
|
+
this._viewModelComponent = com;
|
|
4280
4281
|
}
|
|
4281
4282
|
/**
|
|
4282
4283
|
* 使用route的视图模型,可以实现通过路由,操作视图
|
|
@@ -4318,6 +4319,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4318
4319
|
//
|
|
4319
4320
|
this.close();
|
|
4320
4321
|
}
|
|
4322
|
+
return this;
|
|
4321
4323
|
}
|
|
4322
4324
|
close() {
|
|
4323
4325
|
if (this.state == ViewState.Closed) {
|
|
@@ -4343,6 +4345,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4343
4345
|
console.error(`close view ${this.toString()}`);
|
|
4344
4346
|
console.error(e.stack);
|
|
4345
4347
|
}
|
|
4348
|
+
return this;
|
|
4346
4349
|
}
|
|
4347
4350
|
refresh() {
|
|
4348
4351
|
try {
|