iview中table里嵌套i-switch、input、select等

iview中table里嵌套i-switch、input、select等

iview中table内嵌套

input

 render:(h,params) => {
               return h('Input',{
                     props: {
                           value:'',
                           size:'small',
                          },
                        on: {
                               input: (val) => {
                    t.data[params.index].estimateTime = val
                            }
                        },
                     })
                   }
View Code

select

 render: (h, params) => {
                             return h('Select',{
                                    props:{
                                    },
                                    on: {
                                       'on-change':(event) => {
                                            this.data[params.index].volumeType = event;
                                        }
                                     },
                                },
                                params.row.action.map((item) =>{
                                    return h('Option', {
                                         props: {
                                             value: item.value,
                                            label: item.name
                                        }
                                     })
                                 })
                            )
                      }
View Code

i-switch

render: (h, params) => {
                            //return h('元素',{元素的性质},'内容')
                            return h('i-switch', {
                                    props: {
                                        size: "large",
                                        value: params.row.status == "true"
                                    },
                                    on: {
                                        'on-change': (value) => {
                                            params.row.status = value;
                                            const th = this;
                                            axios.get(th.url + '/departmentType/updateStatus', {
                                                params: {
                                                    dId: params.row.dId,
                                                    status: value
                                                }
                                            }).then(function(res) {
                                                if (res.data.code === 1028) {
                                                    th.$Message.success(res.data.message);
                                                } else {
                                                    th.$Message.error(res.data.message);
                                                    th.changePage(1);
                                                }
                                            })

                                        }
                                    }
                                },
                                [h('span', {
                                        slot: "open",
                                        domProps: {
                                            innerHTML: '正常'
                                        }
                                    }),
                                    h('span', {
                                        slot: "close",
                                        domProps: {
                                            innerHTML: '冻结'
                                        }
                                    }),
                                ]
                            )
                        }
View Code

InputNumber

render: (h, params) => {
                            return h('div', [
                                h('InputNumber', {
                                    props: {
                                        size: "large",
                                        value: params.row.dSort
                                    },
                                    on: {
                                        'on-change': (value) => {
                                            this.DepartmentType.dId =params.row.dId;
                                            this.DepartmentType.dSort = value;
                                            this.updateSort();
                                            
                                        }
                                    }
                                })
                            ])
                        }
View Code

posted @ 2018-12-26 19:55 韦邦杠 阅读(...) 评论(...) 编辑 收藏
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值