zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    5.6移植Madplay到开发板
    5.4.Makefile
    5.3交叉工具链使用
    5.2嵌入式linux程序编译与调试
    5.1Minicom 通信配置-linux环境
    7.点亮led的操作
    6、异常向量表的学习---设置SVC模式
    4.协处理器访问指令
    3.Arm机器码
    android RelativeLayout控件或view实现叠加效果
  • 原文地址:https://www.cnblogs.com/weibanggang/p/10181323.html
Copyright © 2011-2022 走看看