mpvue

MPVue was developed by the Meituan review team. It is a front-end framework for developing small programs using Vue.js. The framework is based on the Vue.js core, and MPVue modifies the Runtime and Compiler implementation of Vue.js.

For developers with experience in Vue development, using MPVue to develop small programs is a good experience. At the same time, there is something called Wepy, which is a Vue-like development style, but it is just like that, without being overhauled from the bottom like MPVue.

The directory architecture of MPVUE is basically the same as the architecture of VUE projects built with VUE-CLI2

├ ─ ─ build ├ ─ ─ the SRC │ ├ ─ ─ components │ ├ ─ ─ pages │ ├ ─ ─ utils │ ├ ─ ─ App. Vue │ └ ─ ─ the main, js ├ ─ ─ the config │ ├ ─ ─ index. The js │ ├ ─ ─ ├ ─ prod.env.js, sigma ─ prod.env.js, sigma ─ static

In fact, the use of MPVUE development of small programs that feeling and the use of VUE development of H5 web pages, only the corresponding plug-in and API are different, of course, MPVUE also has a lot of pits in it, here to share with you.

· Currently, there is no MPVUE specific UI component. Of course, it is possible to copy the code of other UI components. ② When jumping to the page, if you use MPVUE development, then the data of the page before jumping is not reset, while the native applet will reset, so for the data that is not reset, it will bring some data chaos hidden, and it is necessary to manually clean the data. According to the results of the experiment, the performance of MVPUE is not very good. And when I use MPVUE-PARSE to parse rich text content, if the data reaches tens of K, then the rendered page will be very slow, including the response of JS is also very slow. ·mpvue does not have app.js, so there is no globaldata. For global variables, we can use the global object to store them. · In the process of developing with vue, if the Ajax data obtained does not involve the DOM, we usually choose to obtain it in the created stage. However, in MPVUE, the life cycle of created is before the Launch of the APP. If the data is obtained by created, the consequences can be imagined. All pages will obtain data when they enter the home page, so in MPVUE, the data is generally acquired in the mounted stage.

MPVUE this framework if in the development time under the constraints of the cost, is a certain advantage, if in the case of ample time, it is recommended to use native development!