首页 > 其他 > 详细

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

时间:2021-09-15 13:38:55      阅读:29      评论:0      收藏:0      [点我收藏+]

代码:

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
            }
          }

 

效果图:

技术分享图片

 

 

 

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

原文:https://www.cnblogs.com/feng-xl/p/15269301.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!