1.父组件给子组件传参数
单个参数 使用props 写在子组件标签属性上即可
子组件得到的props
props —> {name: “sss”, children: Array(6)}
集合 {arr} 写在插槽里面 插槽里的数据在props的children数组里面接收
{name: “sss”, children: Array(6)}
2.父组件给子组件传DOM
直接写在插槽里面,props.children接受
let arr = [1,2,3]
# 标题
{arr} ----> {[1,2,3]}
let list = [dom1,dom2,dom3] (一般是map的返回)
{[
dom1,
dom2,
dom3,
]}
---> {list}