在父组件中无法访问到子组件中的数据,需要展示的数据还是子组件中的数据,但是展示的方式不同;通过设置slot-scope属性可以获取到子组件模板插槽中绑定的数据。
在父组件中无法访问到子组件中的数据,需要展示的数据还是子组件中的数据,但是展示的方式不同;通过设置slot-scope属性可以获取到子组件模板插槽中绑定的数据。
=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>vue-Slot
引言在HarmonyOS NEXT中,如何实现类似Vue-Slot或React-RenderProps的功能?
developer.mozilla.org/zh-CN/docs/Web/Web_Components/Using_templates_and_slots [2] Github: https://github.com/GpingFeng/vue-slot [4] 官网: https://cn.vuejs.org/v2/guide/render-function.html [5] Github: https://github.com/GpingFeng/vue-slot