03-插槽的使用(具名插槽、作用域插槽)

1.插槽 (组件components)

2.具名插槽:slot 加入name属性,父组件修改根据slot = name


components:{
"cpn : { template : '#cpn'}
}

2.作用域
子组件及父组件作用域;

3.作用域插槽
父组件获取子组件插槽的数据

{{slot.data}}

posted @ 2020-11-04 13:03  PGD  阅读(119)  评论(0)    收藏  举报