CtMobile-React
A mobile framework that supports multiple forms of page switching, page transitions, page values, notifications, etc., for developing single page applications (SPA), hybrid development (Hybrid), Cordova development, CtMobile-React is in " CtMobile", plus support for React .
Development inspiration
When I first came into contact with Hybrid development, the company chose jQueryMobile+Cordova to develop hybrid applications. When using jQueryMobile, I encountered many problems. For example, management class and Dom are not well integrated. Together, the original idea was that if each partial page on the browser side and its management class can be just like the Activity in Android, so the inspiration comes, and the implementation of CtMobile is completely realized by the Activity in Android.
Three concepts
CtMoble has three important feelings, namely Page, Router, BorasdCast. Page is used to manage the entire life cycle of page creation, initialization, and destruction. Router manages the routing jump of this framework. BorassdCast is used to manage the communication interaction between the notification and the data between the pages.
Page startup mode
- standard Multiple case mode
- single Singleton mode (destroyed when clicked back)
- singleInstance Complete singleton mode (will not be destroyed at any time)
- result With a return value (you can bring back the return value to the parent page)
singleInstanceResult A complete singleton with a return value (will not be destroyed, can bring back the return value to the parent page)
Page transition effect
Switch between pages to support multiple effects
Slideleft-From right to left(overlay)
- slideright-From left to right(overlay)
- slideup-From bottom to top(overlay)
- slidedown-From top to bottom(overlay)
- wxslideleft-Similar to WeChat from right to left
- wxslideright-Similar to WeChat from left to right
- wxslideup-Similar to WeChat from bottom to top
- wxslidedown-Similar to WeChat from top to bottom
- pushslideleft-From right to left(push)
- pushslideright-From left to right(push)
- pushslideup-From bottom to top(push)
- pushslidedown-From top to bottom(push)
- material-Android Material style
Other functions
- Passing values between pages
- Whether the new page adds a history stack
- Function can be called through configuration and api