there are many forms of additions, deletions, changes and queries in Mini Program"s project, and the following problems are encountered:
-
form validation, required items, format requirements, etc. are now manually written functions for verification. Each page needs to write a lot of if else, separately, which is long and smelly. Is there any systematic solution?
let error = "" if (!form.email){ error = "" }else if (!tools_verify.checkStr(form.email,"email")){ error = "" }else if(!form.password){ error = "" } else { error = "" }
- selector picker, has many options. It usually jumps to another list page to search and select, with a value passed-get value-selected value-return obtained value, including data update and other operations, which is very tedious and time-consuming. Is there any good way to simplify this;
- form modification, update. Because when Mini Program jumps back to the page, if the data is not deliberately loaded and initialized in onShow, the data will be cached automatically, sometimes resulting in abnormal or disordered display. But all page entry requests are made, and the experience is quite poor, and loading, loads are slow everywhere. How to optimize?