zoukankan      html  css  js  c++  java
  • vue配合iview,render使用

    //循环数据添加div(点击事件)
    render: (h, params) => {//h,表示当前的元素,params表示获取的接口的数据,params.row获取数据中的行的数据,params.row.isMessageCompletion获取数据中的行数据中的isMessageCompletion这个表格的数据
    return h('div', {//此时h表示div
    style: {
    color: 'red',
    cursor: 'pointer',
    },
    attrs: {
    class: params.row.isMessageCompletion === false ? 'orz':'',//params.row.isMessageCompletion获取数据中的行数据中的isMessageCompletion这个表格的数据
    },
    on: {
    'click': (event) => {}
    }
    }, this.tableData[params.index].sampleDressCode)//params.index当前数据的下标
    }
     
    渲染多个
    render:(h,params)=>{
      if(parasm.row.state === 1){
        return h('div',[
              h('a', {
                                            attrs: {
                                                class: 'aClass'
                                            },
                                            on: {
                                                click: () => {
                                                    this.jumpDetail(params.row.sampleDevReimId)
                                                }
                                            }
                                        }, '详情'),
                                        h('a', {
                                            attrs: {
                                                class: 'aClass'
                                            },
                                            on: {
                                                click: () => {
                                                    this.jumpEdit(params.row.sampleDevReimId)
                                                }
                                            }
                                        }, '编辑'),
      ])
      }
    }
  • 相关阅读:
    VMware coding Challenge: Coin Toss Betting
    Lintcode: k Sum II
    Lintcode: Interleaving Positive and Negative Numbers
    Lintcode: Insert Node in a Binary Search Tree
    Amazon OA
    Leetcode: Best Time to Buy and Sell Stock IV
    Leetcode: Reverse Words in a String II
    Leetcode: Repeated DNA Sequence
    Leetcode: Rotate Array
    VMware coding Challenge:Date of Weekday
  • 原文地址:https://www.cnblogs.com/wssdx/p/10644641.html
Copyright © 2011-2022 走看看