There is a problem with the use of render function props to pass values in the iview table

When using the table in iview, you cannot avoid using the render function to render custom content or render components. However, in normal use, the props pass value cannot be recognized,

According to the official website, use props as follows:

render: (h, params) => {
    return h('div', [
        h('Input', {
            props: {
                value: params.row.maxCommissionAmount,
                type: 'number',
                min:'0'
            },                                   
            style: {
              width: '100%',
              height: '25px',
              border: '1px solid #dcdee2',
              borderRadius: '4px',
              textAlign: 'center',
              outline: 'none',
            },
           
            
        })
    ])
}

Unrecognized directly using props assignment

To transfer props to domProps, so that you can pass the value normally

render: (h, params) => {
    return h('div', [
        h('Input', {
            domProps: {
                value: params.row.maxCommissionAmount,
                type: 'number',
                min:'0'
            },                                   
            style: {
              width: '100%',
              height: '25px',
              border: '1px solid #dcdee2',
              borderRadius: '4px',
              textAlign: 'center',
              outline: 'none',
            },
           
            
        })
    ])
}

This article is reproduced in: Ape 2048 → https://www.mk2048.com/blog/blog.php?id=h01ki2jh2bb

Guess you like

Origin www.cnblogs.com/10manongit/p/12742490.html