1. v-bind:id 《=》 :id 和 v-on:click 《=》@click
2. 计算属性只有getter方法,可以手动添加setter方法
3. v-if与v-show的区别,v-show dom中仍然会渲染
4. 对象更改检测 Vue.set(object, key, value)
方法向嵌套对象添加响应式属性。
5. 作用域插槽
<h3 slot-scope="scope">数据 --- {{scope}} -- {{scope.sinfo.name}}</h3>
Vue.component('my-com1', {
template: `<div>
<p>*** 作用域插槽的演示</p>
<slot msg="this is a msg" :sinfo="info"></slot>
</div>`,
data() {
return {
info: {
name: 'zs',
age: 22,
address: '北京'
}
}
}
})
6. 兄弟组件传值
const bus = new Vue()
bus.$emit('aa', this.msg)