vue project. The code written in the template of the .vue file needs to be parsed with the help of the webpack template parser plug-in. When a single .html file introduces a vue file, the vue file also introduces the template parser (the disadvantage is that it is large in size). Therefore, when we use engineering development projects, we need to introduce vue-template-compile in the package.json file for template parsing. If there is no template parser, it cannot be parsed, but vue-template-compile can only parse templates in .vue files, and cannot parse templates in .js files: So when we write this, it won't work. Why can't it be parsed? Because the vue file introduced by the main.js file does not have a template parser vue.runtime.common.js is a .vue file without a template parser, and vue.js is a vue file with a template parser If we import the vue.js file with the template parser in main.js, we can parse the template Why is the vue.js file without template parser imported by default? Solution,Use the official render function. He can call the introduced vue-template-compile through the h function, that is, the ninth line of code is equivalent to the eleventh and twelfth lines plus the loader template parser. Summarize: This article ends here. I hope it can be helpful to you. I also hope that you can pay more attention to more content on 123WORDPRESS.COM! You may also be interested in:
|
<<: Implementation of remote Linux development using vscode
>>: MySQL derived table (Derived Table) simple usage example analysis
Maybe I started to think wrongly, and my descript...
In this article, I will explain the relevant cont...
For example, users who need screen reading softwar...
Table of contents Preface Introduction to QueryCa...
1. Table structure 2. Table data 3. The query tea...
Table of contents Preface vue.config.js configura...
There is a picture in a big box. When you put the...
background A specific device is used to perform i...
Table of contents Project Creation Project Struct...
Table of contents Introduction to utf8mb4 UTF8 by...
This article lists some tips and codes about form...
Add multiple lines to the specified file in Docke...
Using the internal function instr in MySQL can re...
1. How to monitor MySQL deadlocks in production e...
1. The role of index In general application syste...