form-create icon indicating copy to clipboard operation
form-create copied to clipboard

自定义title时,控制台给出警告。如何优雅的使用form.item的slot?

Open yzllee opened this issue 3 years ago • 2 comments

版本号: "@form-create/element-ui": "^3.1.13"

"element-plus": "^2.2.14" "vue": "^3.2.37"

问题: 自定义form-itemlabel的时候使用title属性:

{
  type: "select",
  field: "id",
  title: {
    title: " ",
    children: [
      {
        type: "span",
        children: ["选择"]
      },
      {
        type: "span",
        children: ["增加选择"],
        style: "color:#409eff",
        on: {
          click: () => {
            this.add();
          }
        }
      }
    ]
}

chrome控制台给出警告:[Vue warn]: Failed setting prop "children" on <span>: value [object Object] is invalid. TypeError: Cannot set property children of #<Element> which has only a getter

期望的结果 :

  1. 控制台无警告
  2. 如何正确使用form.itemslot

ps: 警告在"@form-create/element-ui": "^3.1.2""element-plus": "^2.0.2"也会有。

yzllee avatar Aug 23 '22 11:08 yzllee

感谢反馈 我这边检查一下

xaboy avatar Aug 29 '22 01:08 xaboy

3.1.14版本已优化警告信息

xaboy avatar Sep 12 '22 14:09 xaboy