template组件只能包含一个组件如
<template>
<div>
<h1>asdasdasd</h1>
<button></button>
</div>
</template>
这几行代码在template中只包含了一个组件div,但是如果改成这样:
<template>
<h1>asdasdasd</h1>
<button></button>
</template>
就会报错,因为新版的vue在template中只能定义一个组件如果定义多个组件请包含在父组件div里面