fix(plugin-layout): 修复判断icon为非文件的bug

This commit is contained in:
万纯 2021-03-24 18:56:41 +08:00
parent 8cb00db93c
commit 1394f72f6e

View File

@ -40,7 +40,7 @@ export const fillMenuByRoute = (menuConfig, routeConfig, dep = 0) => {
if (menu.icon) {
const icon = menu.icon;
const urlReg = /^((https?|ftp|file):\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
if (!(urlReg.test(icon) || icon.includes('.svg'))) {
if (typeof icon === 'string' && !((urlReg.test(icon) || icon.includes('.svg')))) {
if (!allIcons[icon]) {
menu.icon = {
type: 'icon',