Precautions
'$w' is occupied
wu-ui has many built-in JavaScript utility functions that are mounted in the $w object, while $w is also mounted in uni, so do not mount variables with the same name in uni.
wu-ui's support for nvue
wu-ui fully supports nvue, allowing you to develop apps without worrying about compatibility issues.
Support for VUE3
wu-ui is fully compatible with 'VUE3' and 'NVUE'.
Technical point requirements
- wu-ui relies on the SCSS preprocessor, so you need to install the "sass/scss compilation" plugin for HBuilder X, as detailed in Quick Start
- wu-ui is developed based on the latest version of HX, which may be incompatible with the old version. If you encounter any problems, please upgrade HX to try and see if it can solve the problem
- wu-ui requires the project to start the V3 version of UniApp, which has great advantages. Please refer to the V3 version introduction for details
About Hbuilder X
uniapp relies on HX, and after six years of development (2018-2023), uniapp has gained strong momentum and thrived. We witnessed the whole process and grew up together with uniapp. We felt that a conscientious enterprise could take root in technology and work hard to unify APP, H5 and small programs. At the same time, we were also indignant that small programs from major manufacturers were operating separately, as if they were retrogressing to the era of Browser wars years ago. Based on our experience, we strongly recommend:
- Developers only use the stable version of HX when developing online projects
- Beginners should not use the HX internal beta version, otherwise they may encounter inexplicable problems and undermine their learning confidence
- Whenever HX updates major features, such as the previous custom component mode, the recent V3 version, the current UniCloud, or future major features related to Nuve, please wait for a while before using them in online projects.
- It is recommended for users who enjoy trying out new products and are familiar with the Uniapp to install stable and beta versions of HX on their computers. They should use beta versions to try out new products and stable versions for development. The two versions should be updated separately and not interfere with each other
Compile and debug
When developing, especially when writing layouts, we recommend using a built-in browser in Chrome or HX. It should be noted that the preview effect of a computer browser is not precise. After writing, you can connect your phone to WiFi on the same LAN as your computer and make minor adjustments on the phone browser. When writing the layout and then writing the logic, if you still need to be compatible with the mini program and APP, be sure to use the APP base and mini program real machine for debugging every time you finish writing a page. This can detect problems early, otherwise it will be cut and sorted out.
Internal network penetration
Sometimes it is necessary to use tools such as peanut shells to penetrate the internal network and allow external people to access local debugging web pages. In this case, due to the 'webpack dev server' default check for hostname, remove this restriction and create a new 'vue. config. js' file in the root directory of the uniapp project (if any, do not create it). Modify the following content:
module.exports={
configureWebpack:{
devServer:{
disableHostCheck: true
}
}
}
module.exports={
configureWebpack:{
devServer:{
disableHostCheck: true
}
}
}
Security zone adaptation (for apps)
In iPhone X and other models, there is an indicator bar at the bottom. If safearea is configured, a native white block will be generated at the bottom. The advantage is that it will not cause accidental touch, but the disadvantage is that the color cannot be modified, which sometimes affects aesthetics. wu-ui has made special arrangements in various areas that may be affected by indicator bars, such as pop-up windows, keyboard components, etc., as detailed in the bottom security zone adaptation
Why are there so many comments in the source code of wi-ui?
Many open source projects intentionally remove annotations when they are released, which may be for the sake of cleanliness and neatness, to reduce volume, or to the extent that the manufacturer believes that users do not know and do not need to read the source code. On the contrary, wi-ui doesn't think so. We will always keep annotations in the released version, which are not meant for us to see, but for users to see. We hope that users can improve work efficiency and learn knowledge by reading the source code during use. Because the philosophy of wi-ui is to "break free from constraints and aspire to freedom," we also hope that if you find any problems or have better implementation methods and ideas during the process of reading the source code, you can provide feedback to us and build a more robust UI framework.