[Bug Report]文档里的table组件的render props传值问题
Environment
macos 12.4/chrom 103.0.5060.53/vue3
Reproduction link
https://run.iviewui.com/Jy83V5OO
Steps to reproduce
props传值未生效
What is expected?
安装文档写的 h("div", [ h( resolveComponent("Button"), { props: { type: "text", size: "small", }, onClick: () => { this.showDeleteModal(params.row); }, }, "移除" ), ]);组件props传值应该生效
What is actually happening?
props传值未生效
vue3文档中写的h函数的传参如下 h( // {String | Object | Function} tag // 一个 HTML 标签名、一个组件、一个异步组件、或 // 一个函数式组件。 // // 必需的。 'div',
// {Object} props // 与 attribute、prop 和事件相对应的对象。 // 这会在模板中用到。 // // 可选的。 {},
// {String | Array | Object} children
// 子 VNodes, 使用 h() 构建,
// 或使用字符串获取 "文本 VNode" 或者
// 有插槽的对象。
//
// 可选的。
[
'Some text comes first.',
h('h1', 'A headline'),
h(MyComponent, {
someProp: 'foobar'
})
]
)
源码中的函数定义是第二个参数不是传children就是props 所以应该直接传属性名 包括style和html的原生属性
我提供的代码的VIEW按钮是我的写法 是可以正确显示的 DELETE按钮是文档写法 不能正确显示
你好,我也遇到了同样的问题,table组件中render函数中props会失效,请问现在有解决办法了吗
你好,我也遇到了同样的问题,table组件中render函数中props会失效,请问现在有解决办法了吗
vue3 的render不需要写props了 。。。