The full version

The full version supports views from HTML

  • Use the Compiler to turn HTML strings with ‘placeholders’ into DOM nodes
  • When the ‘placeholder’ is replaced, the DOM node is modified directly without recompilation
  • Finally, the final page effect is obtained through DOM node analysis
  • The full version of Vue is not recommended because of the complexity of the compiler and its large footprint

Partial (runtime) + Vue-loader

The incomplete version only supports building views with JS

  • Because the incomplete version does not have the Compiler compiler, you cannot turn HTML strings into DOM nodes
  • Js is a hassle to build views but what if you want to use it because the incomplete version is small?

Borrow from webpackvue-loader

Translate the.vue file into the H build method

  • At the beginning of the yarn build, vue-Loader converts the HTML string into the H function, at which point the HTML has been compiled
  • Vue-loader is operated during YARN Build and does not need to be downloaded
  • Therefore, users can download the version that only supports H function, that is, the incomplete version to achieve a better use experience

Vue unit components (.vue files)

  • The template tag writes HTML to the view
  • The script tag writes options outside of the view and exports by default
  • The style tag writes the style

How to use it?

  • Import a. value in main.js
  • Vue-loader automatically turns it into object A
  • Use render() in the Vue instance to return an H function
  • That’s translating the HTML inside the template tag into h()
  • Object A actually has a render method that automatically converts, so it doesn’t need to be written in the component


Vue – the role of the loader

Version of the difference between