cosey 0.11.5 → 0.11.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/tree.js +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.11.5",
3
+ "version": "0.11.6",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/utils/tree.js CHANGED
@@ -109,8 +109,11 @@ function mapTreeExtra(tree, callback, options, _internalLevel = 1) {
109
109
  }
110
110
  function getNextSibling(node, mergeLast) {
111
111
  if (node) {
112
- const nextSibling = node.nextSibling;
113
- if (nextSibling && (!mergeLast || nextSibling.reverseLevel > 1 || nextSibling.prevSibling?.reverseLevel !== 1)) {
112
+ let nextSibling = node.nextSibling;
113
+ while (mergeLast && nextSibling && nextSibling.reverseLevel === 1 && nextSibling.prevSibling?.reverseLevel === 1) {
114
+ nextSibling = nextSibling.nextSibling;
115
+ }
116
+ if (nextSibling) {
114
117
  return nextSibling;
115
118
  } else {
116
119
  return getNextSibling(node.parent, mergeLast);