谁能给我一个在asp.NETCore中做侧菜单的例子?我下面有一个例子,但我不知道如何使用它。
[
{
"MenuName": "Hirer HP Transactions",
"MenuList": [
{
"MenuName": "HP Application Master",
"MenuList": []
},
{
"MenuName": "HP Hirer Master",
"MenuList": []
},
{
"MenuName": "HP Collection",
"MenuList": []
},
{
"MenuName": "Post Dated Cheque",
"MenuList": []
},
{
"MenuName": "Operation Reports",
"MenuList": []
}
]
},
{
"MenuName": "Vehicle Trading Transactions",
"MenuList": [
{
"MenuName": "Purchase Agreement",
"MenuList": [
{
"MenuName": "Open Vehicle Module",
"MenuList": []
},
{
"MenuName": "Open / Unsold Vehicles",
"MenuList": []
},
{
"MenuName": "Import Vehicle Delivery Monitoring",
"MenuList": []
}
]
},
{
"MenuName": "Sales Order",
"MenuList": []
},
{
"MenuName": "Sales Agreement",
"MenuList": []
},
{
"MenuName": "Stock Master",
"MenuList": []
},
{
"MenuName": "Operation Reports",
"MenuList": []
}
]
}
]
1条答案
按热度按时间oxiaedzo1#
简短回答:
查询数据库并获取菜单数据
将菜单呈现为html。
既然您已经有了菜单数据,我将向您展示如何用大约40行javascript代码来呈现它:
首先,创建一个
Sidebar.lib.js
有助于将菜单呈现为html:现在可以动态创建侧边栏: