require(“@/xxxxxxxx”) 失败
import(“@/xxxxxxxx”) 失败
const menuConfig = reactive({
currentChildIndex: 0,
showChildMenu: false,
currentChildList: [],
list: [
{
name: t("message.hsHome"),
to: "Home",
root: "Home",
icon: "home.png",
active: true,
},
{
name: t("message.hsOrderManage"),
to: "CollectManage",
icon: "order.png",
children: [
{
title: "收款管理",
name: "CollectManage",
},
{
title: "付款管理",
name: "PayManage",
},
{
title: "异常订单",
name: "OrderException",
},
],
root: "OrderManage",
active: false,
},
{
name: t("message.hsChargeFlow"),
to: "ChargeFlow",
icon: "flow.png",
root: "ChargeFlow",
children: [
{
name: "ChargeFlow",
title: "充值",
},
{
name: "FlowCash",
title: "提现",
},
],
active: false,
},
{
name: t("message.hsWallectManage"),
to: "AssetsManage",
icon: "wallect.png",
children: [
{
title: "钱包管理",
name: "AssetsManage",
},
{
title: "币种管理",
name: "CoinManage",
},
],
root: "WallectManage",
active: false,
},
{
name: t("message.hsSystemManage"),
icon: "setting.png",
to: "RiskManage",
children: [
{
title: "风控管理",
name: "RiskManage",
},
{
title: "API Key管理",
name: "ApiKeyManage",
},
{
title: "品牌管理",
name: "BrandManage",
},
],
root: "SystemManage",
active: false,
},
],
});
/**
* @description: 将图片导为模块
* @param {*} name
* @return {*}
*/
const getImage = (name: string): string => {
// 获取图片模块
const picModules = import.meta.globEager('/src/assets/menu/*');
// 获取指定的图片
const path = (`/src/assets/menu/${name}`);
return picModules[path].default
}