span v-once这个将不会改变: {{ msg }} span
v-on:click="函数"
v-on:click.native="原生函数"
v-on:keyup.enter="函数"
v-on:keyup.13="函数"
@click="函数" [简写]
@click="add($event)" 原生DOM
input type="text" v-model="message"
input type="text" v-model.lazy="message" change改变执行[失去焦点]
input type="text" v-model.number="message" 只能为数字
input type="text" v-model.trim="message" 去掉首尾空格
v-bind:href="url"
:href="url"[简写]
div v-pre {{message}} div
与css配合
[v-cloak] {
display: none;
}
var app=new Vue({
el:'#app',
data:{
message:'hello Vue!'
},
template:'#demo3'
})
components:{
"panda":{
template:`div style="color:red;" 局部注册的panda标签 div`
}
}
type: String, 类型
required: true 必转
default: 100 默认
validator:() => {} 验证
computed:{
newPrice:function(){
return this.price='¥' + this.price + '元';
}
}
new header_a({propsData:{a:1}}).$mount('header');
需要在props里面接收这个参数
methods:{
add:function(){}
}
watch:{
a:function(){} //监控a数据
}
mixins: [mixin] 混入mixin实例
混入对象的钩子将在组件自身钩子之前调用
var CompB = {
extends: CompA, 扩展CompA实例
...
}
delimiters:['${','}']