Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error)
Errors compiling template:
Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.
这里是vue2的做法
是因为template中有其他标签必须被一个div标签包裹在内, 改成下面这样
<template>
<div>
<h1></h1>
<h2></h2>
</div>
</template>
vue3中template里面可以多标签,因为代码编译时会被自动在最外层包裹fragment(fragment元素并不会被渲染)
<template>
<h1></h1>
<h2></h2>
</template>