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

一、修改菜单组件
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.运行结果如下图:
在这里插入图片描述

发布了17 篇原创文章 · 获赞 0 · 访问量 591

猜你喜欢

转载自blog.csdn.net/qq_38711927/article/details/103858255