Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
409 views
in Technique[技术] by (71.8m points)

vue的渲染函数式组件,slot传入的如何添加props

最近在学习vue,发现函数式组件的无上下文虽然可以传入插槽,但怎么给插槽添加props呢?如图

子组件

image.png

我想让插槽传入的header也 添加绑定事件或者ctx.data,要怎么做呢?

父组件

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

一般而言 我是直接使用 this.$children去直接添加的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...