zoukankan      html  css  js  c++  java
  • render函数里面实现for循环的写法

    核心代码
    render: (h, params) => { let texts = ''; //表格列显示文字 let index = params.row.IpAddress.indexOf(',') if (params.row.IpAddress !== null) { if (index > -1) { texts = params.row.IpAddress.substring(0, index) + "..."; } else { texts = params.row.IpAddress; } } let IPArr = params.row.IpAddress.split(',') // console.log('组合的数组是:', IPArr) return h('Tooltip', { props: { // content: params.row.IpAddress, placement: "left-start" }, style: { cursor: 'pointer' } },[ texts, IPArr.map(function (item,index) { return h('div',{ slot: 'content', style: { whiteSpace: 'normal', wordWrap: 'break-word' } }, [ h('p' , item) ]) }) ]) // return h('Tooltip', { // props: { // // content: params.row.IpAddress, // placement: "left-start" // }, // style: { // cursor: 'pointer' // } // }, [ // // h('span', params.row.IpAddress) // texts, // h('div', { // slot: 'content', // style: { // whiteSpace: 'normal', // wordWrap: 'break-word' // } // }, [ // h('p' , IPArr[0]), // h('p' , IPArr[1]), // h('p' , IPArr[2]), // h('p' , IPArr[3]) // ]) // ]) }
  • 相关阅读:
    [CF149D] Coloring Brackets(区间dp)
    [CF1437E] Make It Increasing(LIS)
    洛谷试题之跳石头
    【模板】深搜和广搜
    高精度阶乘
    【模板】拓扑排序
    【模板】最小生成树——Kruskal算法
    判断素数的方法
    高精度乘法
    高精度加法
  • 原文地址:https://www.cnblogs.com/JeneryYang/p/10209222.html
Copyright © 2011-2022 走看看