@keyblade/pro-components 0.0.1-alpha.8 → 0.0.2

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.
@@ -22,7 +22,7 @@ function useHooks(menuItems, options) {
22
22
  var _a2;
23
23
  let find = false;
24
24
  for (const i in _menuItem) {
25
- if (_menuItem[i].name === ((_a2 = activeMenuItem.value) == null ? void 0 : _a2.name)) {
25
+ if (_menuItem[i].name === ((_a2 = activeMenuItem == null ? void 0 : activeMenuItem.value) == null ? void 0 : _a2.name)) {
26
26
  find = true;
27
27
  menuItemPaths.push(_menuItem[i]);
28
28
  }
@@ -45,6 +45,12 @@ function useHooks(menuItems, options) {
45
45
  breadcrumbItems.value = ((_a = activeMenuItem.value) == null ? void 0 : _a.breadcrumbs) ? (_b = activeMenuItem.value) == null ? void 0 : _b.breadcrumbs : activeMenuItemTitles.length !== 0 ? activeMenuItemTitles : [];
46
46
  };
47
47
  function setTabs() {
48
+ if (!activeMenuItem.value) {
49
+ tabs.value.forEach((tab) => {
50
+ tab.active = false;
51
+ });
52
+ return;
53
+ }
48
54
  const { name: menuItemName, title: menuItemTitle, noAffix } = activeMenuItem.value;
49
55
  if (noAffix) {
50
56
  return;
@@ -119,13 +125,10 @@ function useHooks(menuItems, options) {
119
125
  fn(JSON.parse(JSON.stringify(menuItems.value)));
120
126
  menuItemMap.value = _menuItemMap;
121
127
  }, { immediate: true });
122
- watch(() => route.name, () => {
123
- const routeName = route.name;
128
+ watch(() => route == null ? void 0 : route.name, () => {
129
+ const routeName = route == null ? void 0 : route.name;
124
130
  activeMenuItem.value = menuItemMap.value[routeName];
125
- if (!(activeMenuItem == null ? void 0 : activeMenuItem.value)) {
126
- return;
127
- }
128
- menuSelectedKeys.value = [activeMenuItem.value.name];
131
+ menuSelectedKeys.value = (activeMenuItem == null ? void 0 : activeMenuItem.value) ? [activeMenuItem.value.name] : [];
129
132
  setBreadcrumbItems();
130
133
  if (options.tabsMode) {
131
134
  setTabs();
package/es/style.css CHANGED
@@ -1,7 +1,5 @@
1
- .keyblade-pro-reuse-tabs {
2
- position: relative;
3
- background-color: var(--color-bg-2);
4
- padding: 4px 20px;
1
+ .keyblade-pro-page-wrapper {
2
+ padding: 0 20px 20px 20px;
5
3
  }
6
4
  .keyblade-pro-layout {
7
5
  width: 100%;
@@ -77,6 +75,8 @@
77
75
  .keyblade-pro-layout-body-collapsed {
78
76
  padding-left: var(--473aa8e0);
79
77
  }
80
- .keyblade-pro-page-wrapper {
81
- padding: 0 20px 20px 20px;
78
+ .keyblade-pro-reuse-tabs {
79
+ position: relative;
80
+ background-color: var(--color-bg-2);
81
+ padding: 4px 20px;
82
82
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keyblade/pro-components",
3
3
  "description": "KeyBlade Pro Components",
4
4
  "author": "yangshuai <704807396@qq.com>",
5
- "version": "0.0.1-alpha.8",
5
+ "version": "0.0.2",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "es/index.js",