uni-app development

The first uniapp love this framework developed APP, met a lot of pits, people fill was a headache. Summarizes some of the problems encountered by bit, we want to have some effect on the development of small partners with just a uniapp.

Some issues to be aware of App development

  • Pictures / file upload (currently uniapp supports upload pictures and picture preview), the non-image file if you want, you need to call third-party applications, currently only supports preview, details refer to the official documentation
  • Relates to the exchange of data between a plurality of pages , using a page stack, the phone return to the physical key and the left side of the page return key, to be noted. Parameters may use different routes depending on the circumstances. Regard page stack , see particularly items needs, and if the project is relatively large, the interaction between data and page data transfer is more complex, pay attention to the processing of data pages.
  • Use components , while some components do not meet the development needs, can be found packaged component file, make changes to related structure, to achieve their desired effect, it should be noted that, after modification, all references to the results page will be the component change. there is some of the effects of the components can not meet the requirements of the project, we need to pay attention to add functionality they need on the basis of these components in the development of this time requires careful testing, add their own features are not the original function conflict, so as not to affect the results of the entire assembly.
  • Use maps api when the need to pay attention, because Google does not support in the country, call Baidu, High German and other third-party services, which have to apply for, fill in the manifest when the package
  • In the image preview and other leave time APP to call third-party software, will leave the APP. That page stack, it should be noted that if the page every time will come calling interface to retrieve data from the background, and the page there is a need to modify the data, to its stored locally, or back to the page will refresh the data again, the problem appears to restore data
  • The project may encounter icon uniapp provided can not meet the needs of the project, the project referenced in some of the icons .ttf file format, you can download High-Logic FontCreator editing software, software to use on their own Baidu query.
  • Because uniapp using vue development, so some method of vue can be used, such as variables can be set globally through vuex, easy to use, but also in a number of projects frequently called methods and constants can be mounted in the main.js on the global vue, other pages, and so on through this call
  • uniapp on setting the top navigation bar have a special way, you can view specific properties in the official website, set up navigation in line with the project requirements
  • During the development process , because some features have been more mature use of plug-in, plug-in line with project requirements can be found in the official plug-in uni market, references to the project, reducing the re-development and save time.
  • Also note that , because it is through HBuilderX developed and used in the project api also with api micro letter applets are similar, so when the test can be run on micro-channel developer tools to facilitate testing some features, but Some APP unique functional modules, micro-channel and developer tools can not test, then need to connect your phone, a real machine testing, you can see what you want to output in the editor's console, so that you can modify test questions.
  • uniapp development request data, keep up the good type of back-end negotiation parameters, to prevent the type of error, can not get the appropriate back-end parameters,
  • Use background image : base64 format picture support; support network paths picture; using a local path background image Note:  
  • Image is less than 40kb, uniapp will automatically be converted to base64 format;
  • Pictures of greater than or equal when 40kb, requires the developers themselves will turn it into base64 format, or to be moved on the server, quoted from the network address
  • Local background image of a reference path only supports absolute path ~ @ beginning, it does not support relative path
  • In a page of data stored locally , the need for timely clearance when leaving the page, the page does not include data from other needs, but in landing and when the need to clear out APP, APP or will affect the original data.
  • When using frame mode , if there is an event to be bound to confirm or cancel button, need to transfer the package in the event structure alone, followed in their event name

Guess you like

Origin www.cnblogs.com/Alone-Michael/p/12072408.html