复习
12.3-数组、object、Vue
<script>
let vm=new Vue({
beforeCreate(){},
created(){},
beforeMount(){},
mounted(){},
beforeUpdate(){},
upadted(){},
beforeDestory(){},
detoried(){},
activated(){},
deactivated(){},
errorCaptur(){},
filters:{
addZero(val){return "0"+val},
addOne(val){return "1"+val}
},
computed:{
sum(){
return this.num1+this.num2;
},
sum:{
get(){return this.num1+this.num2},
set(val){
let arr=val.split("-");
this.num1=arr[0];
this.num2=arr[1];
}
}
},
watch:{
sum(newval,oldval){
let arr=newval.split("-");
this.num1=arr[0];
this.num2=arr[1];
}
},
handel(a,b,ev){
}
}
)
let obj={};
</script>
12.9-vue组件化
/ 局部组件:想要调用需要导入并注册的组件
全局组件:在main.js中将组件注册到全局,想用直接调用,无需导入注册
插槽slot的作用;保证插件的复用性和可扩展性
虚拟DOM:_vnode,表示非真实的DOM
虚拟dom工作过程:
状态值和属性值:
组件库有哪些:
样式私有化:
组件之间传参
组件生命周期
|