ViewUIPlus icon indicating copy to clipboard operation
ViewUIPlus copied to clipboard

[Bug Report]文档里的table组件的render props传值问题

Open AiFu-o opened this issue 3 years ago • 2 comments

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按钮是文档写法 不能正确显示

AiFu-o avatar Jul 15 '22 01:07 AiFu-o

你好,我也遇到了同样的问题,table组件中render函数中props会失效,请问现在有解决办法了吗

sunyangy avatar Jun 27 '23 09:06 sunyangy

你好,我也遇到了同样的问题,table组件中render函数中props会失效,请问现在有解决办法了吗

vue3 的render不需要写props了 。。。

AiFu-o avatar Jun 29 '23 01:06 AiFu-o