组件refresh时oakFullpath容错

This commit is contained in:
wenjiarui 2023-05-31 13:44:35 +08:00
parent 6b07fb8e28
commit f2ebcd73bb
5 changed files with 11 additions and 10 deletions

View File

@ -28,7 +28,7 @@ var Navigator = /** @class */ (function (_super) {
return {
pathname: pathname,
state: options,
key: ''.concat(pages.length - 1),
key: "".concat(pages.length - 1),
};
};
Navigator.prototype.getNamespace = function () {

View File

@ -955,14 +955,14 @@ var ListNode = /** @class */ (function (_super) {
}
if (append) {
_this.ids = (_this.ids || []).concat(ids);
} else {
}
else {
_this.ids = ids;
}
if (append) {
_this.aggr = (_this.aggr || []).concat(
aggr || []
);
} else {
_this.aggr = (_this.aggr || []).concat(aggr || []);
}
else {
_this.aggr = aggr;
}
})];

View File

@ -110,8 +110,9 @@ function onPathSet(option) {
cascadeActions: cascadeActions_1 && (function () { return cascadeActions_1.call(_this); }),
});
this.subscribed.push(features.runningTree.subscribeNode(function (path2) {
var _a;
// 父结点改变,子结点要重渲染
if (_this.state.oakFullpath.includes(path2)) {
if ((_a = _this.state.oakFullpath) === null || _a === void 0 ? void 0 : _a.includes(path2)) {
_this.reRender();
}
}, oakPath2));

View File

@ -42,7 +42,7 @@ export async function onPathSet<
// 这里在跳页面的时候用this.navigate应该可以限制传过来的filter的格式
const oakFilters2 = typeof oakFilters === 'string' ? JSON.parse(oakFilters) : oakFilters;
filters2.push(...oakFilters2);
}
}
if (filters) {
for (const ele of filters) {
const { filter, '#name': name } = ele;
@ -103,7 +103,7 @@ export async function onPathSet<
features.runningTree.subscribeNode(
(path2) => {
// 父结点改变,子结点要重渲染
if (this.state.oakFullpath.includes(path2)) {
if (this.state.oakFullpath?.includes(path2)) {
this.reRender();
}
},

View File

@ -16,7 +16,7 @@
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "lib", /* Redirect output structure to the directory. */
"rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */