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

Categories

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

vue中Render函数式组件,当无上下文时,slot要怎么用

例如 父组件定义了一个header,在函数式组件内部应该怎么去写呢

image.png

这里的ctx.slots.header并没有起作用,span没有显示

image.png
image.png

还有请教一下大神,ctx中的slots和scopeSlots到底应该怎么使用呢?


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

1 Answer

0 votes
by (71.8m points)

可以仔细看下vue官方文档函数式组件


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