JavaScript

极简的JS函数

怎么用?

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

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

ajax

组件 触发字符
mui.ajax()
maj
ax
mui.post()
mpo
st
mui.get()
mge
t
mui.getJSON()
mjs
on

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