【raETable】🎉toB的小伙伴看过来,raETable又有新功能了🎉

1,965 阅读1分钟

往期回顾

好消息,今天发布第四个版本了,除了完善文档,主要更新的功能是

  • 🚀支持表单的联动

raETable是一款面向toB业务的快捷组件库,名字是react antd Easy Table 的缩写。旨在让开发者在react中使用 antdTable时更 easy。

文档地址:mmdctjj.github.io/raetable/

githup地址:github.com/mmdctjj/rae…

NPM version NPM downloads

🚀表单联动

表单中经常遇见的场景是:当A栏目的值发生变化,B栏目也需要重新选择。

今天raETable支持这个功能了,你只需在column使用linked字段指定需要联动的字段,当这个栏目触发onChange事件时,当前栏目就会清空当前值了。


const columns = [
  {
    dataIndex: 'admin',
    key: 'admin',
    title: 'admin',
    affairType: 'Select',
    conditionType: 'Select',
    options: [
      {
        key: 1,
        value: true,
        label: '是',
      },
      {
        key: 2,
        value: false,
        label: '否',
      },

    ],
  },
  {
    dataIndex: 'eat',
    key: 'eat',
    title: 'eat',
    affairType: 'Select',
    conditionType: 'Select',
    linked: 'admin', // 指定这个栏目进行联动
    options: [
      {
        value: 1,
        label: '牛肉',
        key: 1,
      },
      {
        value: 2,
        label: '鸡蛋',
        key: 2,
      }
    ],
  },
]

down.gif

一个激进的方案是可以根据联动的值,动态的加载下拉框的内容,或者自动填入预设的值,这种方案还有待大家的反馈,如果需要下个版本会加入这个功能。

raETable已经保持四次周更状态了,以后会继续保持这个更新状态,每周更新feature或者发现的bug

欢迎做toB业务的小伙伴积极提出新的常用场景,或者使用中发现的bug

raetable - npm - Google Chrome 2023_5_21 23_10_14.png