当前位置: 代码迷 >> 综合 >> ExtJS6.2开发-首页左菜单添加菜单数据(四)
  详细解决方案

ExtJS6.2开发-首页左菜单添加菜单数据(四)

热度:86   发布时间:2023-12-25 23:34:06.0

一、修改菜单组件
1.找到app目录下main\core\index\component\indexLeftMenu.js文件
2.修改initComponent函数,代码内容如下:

initComponent : function() {
    this.style = "";this.store = Ext.create('Ext.data.TreeStore', {
    root : {
    text : '系统菜单',leaf : false,expanded : true,children : [{
    text :'系统管理',leaf : false,expanded : true,children:[{
     text : '用户管理' , leaf : true },{
     text : '组织管理' , leaf : true },  ]}]}});this.callParent(arguments);}

注:此处数据全部是静态数据,后面会修改为后台动态数据。

3.运行结果如下图:
在这里插入图片描述