At least one <template> or <script> is required in a single file component.

This grammatical error is reported when a new vue3 project is introduced into the route. Check the version and there is nothing wrong with the wording. The literal meaning is that the template cannot be parsed.

I downloaded a template interpreter without thinking about it npm i vue-template-compiler

but nothing happened

After struggling for a while, I remembered that I introduced a routing file (vue file) because the newly created file has not written the html part, which is an empty file.

So just add this template structure

 

 

Guess you like

Origin blog.csdn.net/qq_51389137/article/details/129175142