mui is an open source front-end UI framework based on the HTML5 specification. It takes advantage of the native capabilities of HTML5 extensions to solve the performance and cross-platform issues of common UI controls. Developers use mui to develop once and then publish it as HTML5 iOS and Android Apps can also be published to mobile browsers at the same time.
The operating environment of this tutorial: windows7 system, HTML5&&mui3.7.2 version, Dell G3 computer.
html5 MUI framework
A style framework matching HTML5
mui framework is a An open source front-end UI framework based on the HTML5 specification, which takes advantage of the native capabilities of HTML5 extensions to solve the performance and cross-platform issues of common UI controls.
The UI component design in MUI is based on iOS 7, supplemented by some Android-specific controls. The MUI framework effectively solves some problems of the original framework and can easily develop high-performance apps.
At the same time, mui can also automatically adapt to ordinary browsers without HTML5 environments and reduce it to ordinary web apps. This allows developers to use mui to develop once and publish it as HTML5 iOS and Android apps at the same time. to the mobile browser.
MUI’s positioning is: the UI framework for mobile apps that is closest to the native experience. It is this positioning that gives rise to several characteristics of MUI: light, small, only involving UI, only born for mobile apps, and native interface style. MUI is different from jQuery in that it does not encapsulate DOM operations and does not do anything unrelated to the UI.
mui official website:
https://dev.dcloud.net.cn/mui/
Overall layout of MUI page
Build the overall layout of the page, the top and bottom navigation bars are fixed, and the specific content is placed in Inside the container
When browsing content, the navigation bar is fixed and only the main content changes
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <link href="css/mui.min.css" rel="stylesheet" /> </head> <body> <header class="mui-bar mui-bar-nav"> <a class="mui-action-back mui-icon mui-icon-close mui-pull-right"></a> <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> <h1 id="标题">标题</h1> </header> <nav class="mui-bar mui-bar-tab"> <a class="mui-tab-item mui-active"> <span class="mui-icon mui-icon-home"></span> <span class="mui-tab-label">What is html5 mui</span> </a> </nav> <div class="mui-content"> //主体内容 </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init() </script> </body> </html>
Built-in methods and objects
mui() method: equivalent to jQuery's $() method, using the css selector to obtain the HTML object and returning the mui object array
Convert the mui object into a DOM object :
var obj1 = mui('#title'); //miu object
var obj2 = obj[0]; //DOM objecteach() method : Equivalent to jQuery's each() method to perform traversal operations
init() method: The MUI framework concentrates many functional configurations in the mui.init() method. To use a certain For this function, you only need to complete the corresponding parameter configuration in the mui.init() method. Currently, the functions supported in the mui.init method include: Create subpages, close pages, gesture event configuration, preloading, Pull down to refresh, pull up to load, and set the system status bar background color
-
scrollTo() method: scroll the window screen to the specified position
mui.scrollTo(ypos[,duration ][,handler])- ypos is an integer value, the y coordinate of the document to be displayed in the upper left corner of the window document display area.
- duration is the rolling time period, the unit is milliseconds.
- Handler is the callback function executed after scrolling ends.
mui.os object: used to determine the current running environment
mui.os.plus: whether to run in the 5 base
mui.os.android , mui.os.ios, mui.os.ipad, mui.os.iphone similar
Event Management
1. Tap event: Click to trigger
element.addEventListener('tap',function(){ //点击响应逻辑 },false);
2. Event binding: mui(selecto1).on(event,selector2,handler);
event is a String type, which means it needs to be monitored The event name, such as "tap", handler is the callback function when the event is triggered, selector1 and selector2 are both selectors, but selector2 must be the descendant selector under the HTML element object represented by selector1
3. Event Cancel: Cancel the bound event
mui(selector).off()//取消selector所有事件 mui(selector1).off(event,selector2)//取消作用于selector2的所有事件 mui(selector1).off(event,selector2,handler)//取消作用于selector2的特定事件
4. Event trigger: Dynamically trigger the event of a specific DOM element mui.trigger(element,event,data);
5 , Gesture events: Introducing commonly used gesture expression methods
Event name | Description | |
---|---|---|
tap | Click the screen | |
doubletap | Double-click the screen | |
longtap | Long press the screen | |
hold | Hold the screen | |
release | Leave the screen | |
swipeleft | Swipe left | |
swiperight | Swipe right Swipe | ##Swipe |
Swipe up | Swipe | |
Swipe down | Drag | |
Drag start | ## Drag | |
Drag | Drag | |
Drag end |
窗口管理
mui.init({ keyEventBind:{ backbutton:true//启用右滑关闭功能} });
mui.init({ preloadPages:[ { url:prelaod-page-url,//页面路径 id:preload-page-id,//Webview的id styles:{},//窗口参数 extras:{},//自定义扩展参数 subpages:[{},{}]//预加载页面的子页面 } ], preloadLimit:5//预加载窗口数量限制(一旦超出,先进先出)默认不限制 });
mui.init({ subpages:[{ url:'list.html', id:'list.html', styles:{ top:'45px',//mui标题栏默认高度为45px; bottom:'45px'//默认为0px,可不定义; } }] }); 相关推荐:《html视频教程》 |
The above is the detailed content of What is html5 mui. For more information, please follow other related articles on the PHP Chinese website!

Yes,ReactapplicationscanbeSEO-friendlywithproperstrategies.1)Useserver-siderendering(SSR)withtoolslikeNext.jstogeneratefullHTMLforindexing.2)Implementstaticsitegeneration(SSG)forcontent-heavysitestopre-renderpagesatbuildtime.3)Ensureuniquetitlesandme

React performance bottlenecks are mainly caused by inefficient rendering, unnecessary re-rendering and calculation of component internal heavy weight. 1) Use ReactDevTools to locate slow components and apply React.memo optimization. 2) Optimize useEffect to ensure that it only runs when necessary. 3) Use useMemo and useCallback for memory processing. 4) Split the large component into small components. 5) For big data lists, use virtual scrolling technology to optimize rendering. Through these methods, the performance of React applications can be significantly improved.

Someone might look for alternatives to React because of performance issues, learning curves, or exploring different UI development methods. 1) Vue.js is praised for its ease of integration and mild learning curve, suitable for small and large applications. 2) Angular is developed by Google and is suitable for large applications, with a powerful type system and dependency injection. 3) Svelte provides excellent performance and simplicity by compiling it into efficient JavaScript at build time, but its ecosystem is still growing. When choosing alternatives, they should be determined based on project needs, team experience and project size.

KeysinReactarespecialattributesassignedtoelementsinarraysforstableidentity,crucialforthereconciliationalgorithmwhichupdatestheDOMefficiently.1)KeyshelpReacttrackchanges,additions,orremovalsinlists.2)Usingunique,stablekeyslikeIDsratherthanindicespreve

ToreducesetupoverheadinReactprojects,usetoolslikeCreateReactApp(CRA),Next.js,Gatsby,orstarterkits,andmaintainamodularstructure.1)CRAsimplifiessetupwithasinglecommand.2)Next.jsandGatsbyoffermorefeaturesbutalearningcurve.3)Starterkitsprovidecomprehensi

useState()isaReacthookusedtomanagestateinfunctionalcomponents.1)Itinitializesandupdatesstate,2)shouldbecalledatthetoplevelofcomponents,3)canleadto'stalestate'ifnotusedcorrectly,and4)performancecanbeoptimizedusinguseCallbackandproperstateupdates.

Reactispopularduetoitscomponent-basedarchitecture,VirtualDOM,richecosystem,anddeclarativenature.1)Component-basedarchitectureallowsforreusableUIpieces,improvingmodularityandmaintainability.2)TheVirtualDOMenhancesperformancebyefficientlyupdatingtheUI.

TodebugReactapplicationseffectively,usethesestrategies:1)AddresspropdrillingwithContextAPIorRedux.2)HandleasynchronousoperationswithuseStateanduseEffect,usingAbortControllertopreventraceconditions.3)OptimizeperformancewithuseMemoanduseCallbacktoavoid


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
