You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
300 B

import { getMatchMenu } from '@umijs/route-utils'; // 获取当前的选中菜单
export var getSelectedMenuKeys = function getSelectedMenuKeys(pathname, menuData) {
var menus = getMatchMenu(pathname, menuData);
return menus.map(function (item) {
return item.key || item.path || '';
});
};