dumi 2.3.5 → 2.3.6
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.
|
@@ -109,9 +109,13 @@ export var useNavData = function useNavData() {
|
|
|
109
109
|
}, {}));
|
|
110
110
|
data.forEach(function (item, i) {
|
|
111
111
|
var _item$children;
|
|
112
|
+
// item.link => the parent link is not in routes, but has children, will use parent.title or children.title
|
|
112
113
|
if (!item.link && ((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length) === 1) {
|
|
113
114
|
// hoist nav item if only one child
|
|
114
|
-
|
|
115
|
+
var first = item.children[0];
|
|
116
|
+
data[i] = _objectSpread(_objectSpread({}, first), {}, {
|
|
117
|
+
title: (item === null || item === void 0 ? void 0 : item.title) || first.title
|
|
118
|
+
});
|
|
115
119
|
} else if (item.children) {
|
|
116
120
|
// sort nav item children by order or title
|
|
117
121
|
item.children.sort(sidebarDataComparer);
|
|
@@ -27,7 +27,11 @@ function getCachedRouteMeta(route) {
|
|
|
27
27
|
var _ref, _ref$key;
|
|
28
28
|
(_ref$key = (_ref = meta)[key]) !== null && _ref$key !== void 0 ? _ref$key : _ref[key] = route.meta[key];
|
|
29
29
|
});
|
|
30
|
-
meta.frontmatter = deepmerge(meta.frontmatter, route.meta.frontmatter
|
|
30
|
+
meta.frontmatter = deepmerge(meta.frontmatter, route.meta.frontmatter, {
|
|
31
|
+
arrayMerge: function arrayMerge(_destinationArray, sourceArray) {
|
|
32
|
+
return sourceArray;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
return meta;
|
|
33
37
|
};
|