时间:2021-07-01 10:21:17 帮助过:35人阅读
首先我们从最基本的看起。
下面是一个简单的多级下拉菜单
代码如下:
nestedMenuItems = [ { type: mui.MenuItem.Types.NESTED, text: 'Reports', items: [ { payload: '1', text: 'Nested Item 1' }, { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 2', items: [ { payload: '1', text: 'Nested Item 2.1' }, { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 2.2', items: [ { payload: '1', text: 'Nested Item 2.2.1' }, { payload: '3', text: 'Nested Item 2.2.2' } ] }, { payload: '3', text: 'Nested Item 2.3' } ] }, { payload: '3', text: 'Nested Item 3' }, { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 4', items: [ { payload: '1', text: 'Nested Item 4.1' }, { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 4.2', items: [ { payload: '1', text: 'Nested Item 4.2.1', disabled: true }, { payload: '3', text: 'Nested Item 4.2.2' } ] }, { payload: '3', text: 'Nested Item 4.3' } ] }, { payload: '4', text: 'Nested Item 5' } ] }, { payload: '1', text: 'Audio Library'}, { payload: '2', text: 'Settings'}, { payload: '3', text: 'Logout', disabled: true} ];
下面是一个带图标的垂直菜单
代码如下:
//iconClassName is the classname for our icon that will get passed into mui.FontIconiconMenuItems = [ { payload: '1', text: 'Live Answer', iconClassName: 'muidocs-icon-communication-phone', number: '10' }, { payload: '2', text: 'Voicemail', iconClassName: 'muidocs-icon-communication-voicemail', number: '5' }, { payload: '3', text: 'Starred', iconClassName: 'muidocs-icon-action-stars', number: '3' }, { payload: '4', text: 'Shared', iconClassName: 'muidocs-icon-action-thumb-up', number: '12' }];
下面是简单的彩色按钮,点击按钮会出现波浪扩散的动画效果。
代码如下:
//Raised Buttons
下面是Material UI经过美化过的单选框和复选框
代码如下:
这是个人觉得最漂亮的CSS日历组件
代码如下:
//Portrait Dialog// Ranged Date Picker
Material UI还有很多有用的CSS UI组件,你可以前往其官方网站下载及学习使用。
本文转自http://www.codeceo.com/article/material-ui.html
版权声明:欢迎转转载,希望转载的同时添加原文地址,谢谢合作,学习快乐!