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
External Access Randomly map ports Using the -P f...
nginx version 1.11.3 Using the following configur...
1. Solution 1.1 Describing the interface context-...
Today I installed the MySQL database on my comput...
In MySQL, you can use the SQL statement rename ta...
This article uses an example to describe how to u...
Table of contents 1. How to obtain different view...
Use auto.js to automate daily check-in Due to the...
Negative distance refers to empathy. Preface (rai...
CentOS6.9 installs Mysql5.7 for your reference, t...
From getting started to becoming a novice, the Li...
Table of contents Preface 1. Configure routing na...
1. To build a PPTP VPN, you need to open port 172...
SQL paging query:background In the company's ...
Table of Contents Introduction Synchronous Asynch...