怎么用?
html
此底色代表最小触发字符
此底色代表非必要完整触发字符
*需HBuilder7.1+,或者下载mui_html_snippets.rb mui_js_snippets.rb替换使用
我们只整理了部分常用到的代码块.欢迎大家提交更多的代码块方便大家开发.
组件 | 触发字符 |
---|---|
mDoctype(mui-dom结构) | mdo ctype |
mBody(主体) | mbo dy |
mScroll(区域滚动容器) | msc roll |
mrefreshContainer(刷新容器) | mre fresh |
mHeader(标题栏) | mhe ader |
mHeader(带返回箭头的标题栏) | mhe aderwithBack |
mCheckbox(复选框) | mch eckbox |
mCheckbox(复选框居左) | mch eckbox_left |
mCheckbox(复选框禁用选项) | mch eckbox_disabled |
mIcon(图标) | mic on |
mOffcanvas(侧滑导航-主界面、菜单同时移动) | mof fcanvasall |
mOffcanvas(侧滑导航-主界面移动、菜单不动) | mof fcanvasmain |
mOffcanvas(侧滑导航-主界面不动、菜单移动) | mof fcanvasmenu |
mOffcanvas(侧滑导航-缩放式侧滑(类手机QQ)) | mof fcanvasscalable |
mText(文本框) | min puttext |
mText_Search(搜索框) | min putsearch |
mText_Clear(带清除按钮的文本框) | min putclear |
mText_Speech(语音输入) | min putspeech |
mForm(表单) | mfo rm |
mRadio(单选框) | mra dio |
mRadio(单选框居左) | mra dio_left |
mRadio(禁用单选框) | mra dio_disable |
mRadios(默认选中指定项) | mra dio_selected |
mPopover(弹出菜单) | mpo pover |
mprogressbar(进度条-无限循环) | mpr ogressbarinfinite |
mprogressbar(进度条-有准确值) | mpr ogressbar |
mActionsheet(H5模式弹出菜单) | mac tionsheet |
mRange(Label+滑块) | mra ngelabel |
mSwitch(开关) | msw itch |
mSwitch(开关 - 蓝色) | msw itch_blue |
mSwitch(开关Mini) | msw itchmini |
mSwitch(开关Mini - blue) | msw itchmini_blue |
mbadge(数字角标) | mba dge |
mbadge(数字角标无底色) | mba dge_inverted |
mTab(底部选项卡) | mta b |
mTabSegmented(div选项卡) | mta bsegmented |
mTabSegmented(可左右拖动的选项卡) | mta bviewpage |
mPagination(分页) | mpa gination |
mList(列表) | mli st |
mListMedia(图文列表图片居左) | mli st_Media_left |
mListMedia(图文列表图片居右) | mli st_Media_right |
mGrid(九宫格) | mgr id |
mGallery-Table(图文表格) | msl ider_gallery_table |
mGallery(图片轮播) | msl ider_gallery |
slide(轮播组件) | msl ider |
mactionsheet(操作表) | act ionsheet |
maccordion(折叠面板) | mac cordion |
mnumbox(数字输入框) | mnu mbox |
mrefreshContainer(刷新容器) | mpu llrefresh |
mButton(按钮) | mbu tton |
mButton(按钮无底色,有边框) | mbu tton_outline |
mButton(块状按钮) | mbu tton_block |
init
组件 | 触发字符 |
---|---|
mui.init | min |
创建子页面( subpage ) | mins ubpage |
预加载页面( preload ) | minp reload |
刷新组件( pullRefresh ) | minp ullRefresh |
手势事件( getures ) | ming esture |
侧滑返回( swipeback ) | mins wipeback |
按键绑定(keyeventbind) | mink eyevent |
重写窗口关闭逻辑(beforeBack) | minb eforeback |
设置状态栏颜色( setStatusbar ) | mins tatusbar |
预加载数量( preloadlimit ) | minp relimit |
js组件
组件 | 触发字符 |
---|---|
mui.plusReady() | mpl usready |
mui.ready | mre ady |
event
组件 | 触发字符 |
---|---|
mui.on(事件绑定) | mmon |
mui.off(事件取消) | mmoff |
mui.trigger()(事件触发) | mtrigger |
mui.fire()(自定义事件) | mfire |
document.getElementById() | dg |
document.querySelector() | ds |
document.querySelector().addEventListener() | dsa |
document.getElementById().addEventListener() | dga |
window.addEventListener() | wad |
document.addEventListener() | dad |
dialog
组件 | 触发字符 |
---|---|
mui.alert()(弹出框) | mda lert |
mui.confirm()(确认弹出框) | mdc onfirm |
mui.prompt()(输入弹出框) | mdp rompt |
mui.toast()(自动消失提示框) | mdt oast |
mui.closePopup()(关闭最外层对话框) | mdc losePopup |
mui.closePopups()(关闭全部对话框) | mdc losePopups |
utils
组件 | 触发字符 |
---|---|
mui() (mui对象选择器) | mmu i |
mui.each()(数组,对象遍历) | mea ch |
mui().each()(DOM遍历) | mme ach |
mui.extends(对象合并) | mex tends |
mui.later() (setTimeOut封装) | mla ter |
mui.scrollTo() (滚动到指定位置) | msc rollto |
mui.os()(判断当前运行环境) | mos |
ajax
组件 | 触发字符 |
---|---|
mui.ajax() | maj ax |
mui.post() | mpo st |
mui.get() | mge t |
mui.getJSON() | mjs on |
webview
组件 | 触发字符 |
---|---|
mui.open(打开新页面) | mop en |
mui.currentWebview (当前页面) | mcu rrent |
mui.back()(关闭窗口) | mba ck |
mui.backFunction()(重写返回逻辑) | mba ckfunction |
mui.backDouble()(双击退出应用) | mba ckDouble |
mui.backTast(双击进入后台) | mba cktast |
mui.preload()(预加载) | mpr eload |
plus
组件 | 触发字符 |
---|---|
plusReady | pre ady |
plus.accelerometer | pac ce |
plus.audio | pau dio |
plus.barcode | pba rcode |
plus.camera | pca mera |
plus.contacts | pco ntacts |
plus.device | pde vice |
plus.gallery | pga llery |
plus.geolocation | pge olocation |
plus.io | pio |
plus.key | pke y |
plus.maps | pma ps |
plus.messaging | pme ssaging |
plus.nativeObj | pna tiveObj |
plus.nativeUI | pna tiveUI |
plus.navigator | pna vigator |
plus.orientation | por ientation |
plus.payment | ppa yment |
plus.proximity | ppr oximity |
plus.push | ppu sh |
plus.runtime | pru ntime |
mui遵循 MIT License