Vue.component

<body>

<div id="app">
    <counter></counter>
    <counter></counter>
</div>
<template id="counter-template">
    <h1>hello</h1>
    <button>Submit</button>
</template>

<script>

Vue.component('counter',{
    template:'#counter-template'
});
new Vue({
    el:"#app"
});

</script>

下面是报错的
(没有找到为什么会报这样的错)

<h1>hello</h1>
<button>Submit</button>
If you are using v-if on multiple elements, use v-else-if to chain them instead.

JellyBool
修改的评论也不能少于六个字哦!
linjixue
修改的评论也不能少于六个字哦!