require(“@/xxxxxxxx”) 失败
    import(“@/xxxxxxxx”) 失败
    image.png

    1. const menuConfig = reactive({
    2. currentChildIndex: 0,
    3. showChildMenu: false,
    4. currentChildList: [],
    5. list: [
    6. {
    7. name: t("message.hsHome"),
    8. to: "Home",
    9. root: "Home",
    10. icon: "home.png",
    11. active: true,
    12. },
    13. {
    14. name: t("message.hsOrderManage"),
    15. to: "CollectManage",
    16. icon: "order.png",
    17. children: [
    18. {
    19. title: "收款管理",
    20. name: "CollectManage",
    21. },
    22. {
    23. title: "付款管理",
    24. name: "PayManage",
    25. },
    26. {
    27. title: "异常订单",
    28. name: "OrderException",
    29. },
    30. ],
    31. root: "OrderManage",
    32. active: false,
    33. },
    34. {
    35. name: t("message.hsChargeFlow"),
    36. to: "ChargeFlow",
    37. icon: "flow.png",
    38. root: "ChargeFlow",
    39. children: [
    40. {
    41. name: "ChargeFlow",
    42. title: "充值",
    43. },
    44. {
    45. name: "FlowCash",
    46. title: "提现",
    47. },
    48. ],
    49. active: false,
    50. },
    51. {
    52. name: t("message.hsWallectManage"),
    53. to: "AssetsManage",
    54. icon: "wallect.png",
    55. children: [
    56. {
    57. title: "钱包管理",
    58. name: "AssetsManage",
    59. },
    60. {
    61. title: "币种管理",
    62. name: "CoinManage",
    63. },
    64. ],
    65. root: "WallectManage",
    66. active: false,
    67. },
    68. {
    69. name: t("message.hsSystemManage"),
    70. icon: "setting.png",
    71. to: "RiskManage",
    72. children: [
    73. {
    74. title: "风控管理",
    75. name: "RiskManage",
    76. },
    77. {
    78. title: "API Key管理",
    79. name: "ApiKeyManage",
    80. },
    81. {
    82. title: "品牌管理",
    83. name: "BrandManage",
    84. },
    85. ],
    86. root: "SystemManage",
    87. active: false,
    88. },
    89. ],
    90. });
    91. /**
    92. * @description: 将图片导为模块
    93. * @param {*} name
    94. * @return {*}
    95. */
    96. const getImage = (name: string): string => {
    97. // 获取图片模块
    98. const picModules = import.meta.globEager('/src/assets/menu/*');
    99. // 获取指定的图片
    100. const path = (`/src/assets/menu/${name}`);
    101. return picModules[path].default
    102. }