The official website introduces independent construction and runtime construction, but it is vague and confusing. I don’t know how to use it in actual work?
PHPz2017-05-19 10:43:36
You can use the template option for independent construction.
Building during runtime is not possible. You can only compile it through the template and convert it into a render function.
伊谢尔伦2017-05-19 10:43:36
1. The independent build includes the template compiler, and the runtime build does not include the template compiler.
2. The function of the template compiler is to compile the template options into the render function. The render function is the key to rendering.
3. In view of the above two points, when using the runtime build, the template option cannot appear because there is no template compiler at this time. But there is one exception: in the case of webpack+vue-loader, it is OK to have template appear in a single-file component.
4. When using vue-cli to generate a project, you will be reminded which build method to use. The npm package exports runtime builds by default. If you need to use independent builds, you need to configure alias in webpack. 5. The two currently discovered The differences in application scenarios are: