vue-layout-gitcode 1.5.9 → 1.5.11
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/{GloabarSearch-wSAuJQWS.js → GloabarSearch-9y3J_EQ-.js} +2 -2
- package/{ProjectSearch-DIGI-G-g.js → ProjectSearch-DjfLnKx7.js} +1 -1
- package/{SearchHistoryList-Dn4ig_fu.js → SearchHistoryList-Bf36OKih.js} +1 -1
- package/{SearchPrefixTag-BGIDbDKK.js → SearchPrefixTag-CWyO4dr2.js} +1 -1
- package/{SearchRecommed-B1THsxwB.js → SearchRecommed-CEW0nRn5.js} +2 -2
- package/{SearchScopeList-DkiBShCQ.js → SearchScopeList-BuQsLlhZ.js} +1 -1
- package/{UserSearch-7rIEz8aN.js → UserSearch-DcgtHQUW.js} +1 -1
- package/{index-DHkIlnbI.js → index-BdbV3qYu.js} +658 -1083
- package/{index-DvEKX1iw.js → index-CW7ErinS.js} +1 -1
- package/{index-D4jzLc17.js → index-D7k-ziG1.js} +1 -1
- package/index.d.ts +34 -3
- package/index.js +11 -11
- package/{notice-m51RmZJl.js → notice-P3LJAv9Y.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/MenuItem-BekffSqp.js +0 -93
package/MenuItem-BekffSqp.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { ref, computed, createElementBlock, openBlock, normalizeClass, createBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
|
-
import { _ as _export_sfc, y as ThemeType, z as currentTheme, j as LANG_ZH, A as LANG_EN, B as getLocaleLang, G as GIcon, C as isHttps } from "./index-DHkIlnbI.js";
|
|
3
|
-
import { useRouter } from "vue-router";
|
|
4
|
-
const _hoisted_1 = ["src"];
|
|
5
|
-
const _sfc_main = {
|
|
6
|
-
__name: "MenuItem",
|
|
7
|
-
props: {
|
|
8
|
-
item: {
|
|
9
|
-
type: Object,
|
|
10
|
-
default: () => {
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
active: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: false
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
setup(__props) {
|
|
19
|
-
const router = useRouter();
|
|
20
|
-
const props = __props;
|
|
21
|
-
const isHover = ref(false);
|
|
22
|
-
const isSelected = computed(() => {
|
|
23
|
-
return props.active || isHover.value;
|
|
24
|
-
});
|
|
25
|
-
const currentImg = computed(() => {
|
|
26
|
-
const imgMap = {
|
|
27
|
-
[ThemeType.WHITE]: {
|
|
28
|
-
selected: props.item.left_menu_logo_hover,
|
|
29
|
-
unselected: props.item.left_menu_logo
|
|
30
|
-
},
|
|
31
|
-
[ThemeType.BLACK]: {
|
|
32
|
-
selected: props.item.left_menu_logo_hover_black,
|
|
33
|
-
unselected: props.item.left_menu_logo_black
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
if (isSelected.value) {
|
|
37
|
-
return imgMap[currentTheme.value].selected;
|
|
38
|
-
} else {
|
|
39
|
-
return imgMap[currentTheme.value].unselected;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const currentName = computed(() => {
|
|
43
|
-
const nameMap = {
|
|
44
|
-
[LANG_EN]: props.item.left_menu_name_en,
|
|
45
|
-
[LANG_ZH]: props.item.left_menu_name_cn
|
|
46
|
-
};
|
|
47
|
-
return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
|
|
48
|
-
});
|
|
49
|
-
const handleMouseEnter = () => {
|
|
50
|
-
isHover.value = true;
|
|
51
|
-
};
|
|
52
|
-
const handleMouseLeave = () => {
|
|
53
|
-
isHover.value = false;
|
|
54
|
-
};
|
|
55
|
-
const handleMenuClick = () => {
|
|
56
|
-
if (props.item.is_open_new_tab) {
|
|
57
|
-
window.open(props.item.left_menu_url, "_blank");
|
|
58
|
-
} else if (isHttps(props.item.left_menu_url)) {
|
|
59
|
-
window.location.href = props.item.left_menu_url;
|
|
60
|
-
} else {
|
|
61
|
-
router.push({
|
|
62
|
-
path: props.item.left_menu_url
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
return (_ctx, _cache) => {
|
|
67
|
-
return openBlock(), createElementBlock("div", {
|
|
68
|
-
class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
|
|
69
|
-
onMouseenter: handleMouseEnter,
|
|
70
|
-
onMouseleave: handleMouseLeave,
|
|
71
|
-
onClick: handleMenuClick
|
|
72
|
-
}, [
|
|
73
|
-
props.item.isIcon ? (openBlock(), createBlock(GIcon, {
|
|
74
|
-
key: 0,
|
|
75
|
-
name: currentImg.value,
|
|
76
|
-
class: "default-icon",
|
|
77
|
-
size: "16",
|
|
78
|
-
color: "var(--theme-menu-icon-fill)"
|
|
79
|
-
}, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
|
|
80
|
-
key: 1,
|
|
81
|
-
class: "menu-item__icon",
|
|
82
|
-
src: currentImg.value,
|
|
83
|
-
alt: ""
|
|
84
|
-
}, null, 8, _hoisted_1)),
|
|
85
|
-
createElementVNode("span", null, toDisplayString(currentName.value), 1)
|
|
86
|
-
], 34);
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
|
|
91
|
-
export {
|
|
92
|
-
MenuItem as default
|
|
93
|
-
};
|