在使用动态 template 的 vue 组件中,如何传递 props 值?

新手上路,请多包涵

我在使用动态 template 的 vue 组件时需要向该组件中的子组件传入该组件接受到的来自根组件的 props,请问如何在 render() 中传递 props 的数据呢?

非常感谢任何帮助的朋友!

更详细的代码在 stackoverflow

阅读 2.9k
1 个回答

首先,render函数的参数是createElement,也就是h,createElement的用法看文档看文档

参数中的props和attrs,on等可以在render函数中使用this.$props,this.$attrs,this.$listeners获取到。

推荐问题