额... 谢谢谢谢
我用的就是这个呢
我看到视频里 用的是vue.mini.js 可是没有找到下载的地方呢
能给个下载vue.mini.js的下载地址么 谢谢啦
Vue.js v2.1.10
这个版本不支持么
<div id="app">
<counter heading="yes" color="green"></counter>
<counter heading="no" color="red"></counter>
</div>
<template id="counter-template">
<div>
<h1> heading </h1>
<button @click="count+=1" style="background: color "> count </button>
</div>
</template>
<script>
Vue.component('counter',{
template:'#counter-template',
props:['heading','color'],
data:function(){
return {count:0};
}
});
new Vue({
el:"#app"
});
</script>
为什么我和视频里的是一样的代码 ,我的确报错呢
这个报错又是哪里造成的呢?这个报错是加上props之后的
好的 解决啦 谢谢
<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"
});
上面是我的代码
为什么会报错呢 求解下面是报错的信息
<h1>hello</h1>
<button>Submit</button>
If you are using v-if on multiple elements, use v-else-if to chain them instead.
<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.