mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
docs: 修改文案
This commit is contained in:
parent
1568398471
commit
e1ab30dd38
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<f-menu
|
<FMenu
|
||||||
v-model:expandedKeys="expandedKeysRef"
|
v-model:expandedKeys="expandedKeysRef"
|
||||||
:modelValue="activePath"
|
:model-value="activePath"
|
||||||
:inverted="inverted"
|
:inverted="inverted"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:options="transformedMenus"
|
:options="transformedMenus"
|
||||||
:defaultExpandAll="defaultExpandAll"
|
:default-expand-all="defaultExpandAll"
|
||||||
:accordion="accordion"
|
:accordion="accordion"
|
||||||
@select="onMenuClick"
|
@select="onMenuClick"
|
||||||
></f-menu>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -20,8 +20,8 @@ import { transform as transformByLocale } from '../helpers/pluginLocale';
|
|||||||
import { flatNodes } from '../helpers/utils';
|
import { flatNodes } from '../helpers/utils';
|
||||||
import MenuIcon from './MenuIcon.vue';
|
import MenuIcon from './MenuIcon.vue';
|
||||||
|
|
||||||
const transform = (menus, level = 1) =>
|
function transform(menus, level = 1) {
|
||||||
menus.map((menu, index) => {
|
return menus.map((menu, index) => {
|
||||||
const copy = {
|
const copy = {
|
||||||
...menu,
|
...menu,
|
||||||
label: menu.title,
|
label: menu.title,
|
||||||
@ -38,6 +38,7 @@ const transform = (menus, level = 1) =>
|
|||||||
}
|
}
|
||||||
return copy;
|
return copy;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -100,7 +101,7 @@ export default {
|
|||||||
watch(
|
watch(
|
||||||
[menuArray, activePath],
|
[menuArray, activePath],
|
||||||
() => {
|
() => {
|
||||||
let index = menuArray.value.findIndex((item) => item.value === activePath.value);
|
let index = menuArray.value.findIndex(item => item.value === activePath.value);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -109,12 +110,12 @@ export default {
|
|||||||
while (index > 0) {
|
while (index > 0) {
|
||||||
index = index - 1;
|
index = index - 1;
|
||||||
const lastMenu = menuArray.value[index];
|
const lastMenu = menuArray.value[index];
|
||||||
if (lastMenu.children && lastMenu.children.indexOf(arr[arr.length - 1]) !== -1) {
|
if (lastMenu.children && lastMenu.children.includes(arr[arr.length - 1])) {
|
||||||
arr.push(lastMenu);
|
arr.push(lastMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
expandedKeysRef.value = expandedKeysRef.value.concat(
|
expandedKeysRef.value = expandedKeysRef.value.concat(
|
||||||
arr.filter((item) => !expandedKeysRef.value.includes(item.value)).map((item) => item.value),
|
arr.filter(item => !expandedKeysRef.value.includes(item.value)).map(item => item.value),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -126,10 +127,12 @@ export default {
|
|||||||
const path = e.value;
|
const path = e.value;
|
||||||
if (/^https?:\/\//.test(path)) {
|
if (/^https?:\/\//.test(path)) {
|
||||||
window.open(path, '_blank');
|
window.open(path, '_blank');
|
||||||
} else if (/^\//.test(path)) {
|
}
|
||||||
|
else if (/^\//.test(path)) {
|
||||||
router.push(path);
|
router.push(path);
|
||||||
} else {
|
}
|
||||||
console.warn('[plugin-layout]: 菜单的path只能使以http(s)开头的网址或者路由地址');
|
else {
|
||||||
|
console.warn('[plugin-layout]: 菜单的path只能是以http(s)开头的网址或者路由地址');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user