Ant Design Vue 列内容columns中customRender 返回一个自定义组件的写法

代码:

element.customRender = (text, row, index) => {
            if (index === 0) {
              return {
                children: this.$createElement(MixSearch, {
                  props: {
                    name: 'purchaseProduct',
                    placeholder: '请输入商品名称/编码/条码',
                    width: '100%',
                    valueMode: true,
                    value: {},
                    next: () => {
                      return this.chooseProductValid(null, null)
                    }
                  },
                  on: {
                    change: args => {
                      this.confirmHandleOfProduct('footer', args)
                    }
                  }
                }),
                attrs: {
                  colSpan: colspanLen
                }
              }
            } else {
              return text
            }
          }

 

效果图:

 

 

 

posted @ 2021-09-14 19:53  小Ling的博客  阅读(6867)  评论(4编辑  收藏  举报