Browse Source

Table: support producer and style in column_options

master
Bing Sun 5 years ago
parent
commit
bfa117bb94
Signed by: sunb GPG Key ID: F7795F8C590626AB
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/components/Table.js

+ 4
- 1
src/components/Table.js View File

@@ -105,7 +105,10 @@ export default initial_vnode => {
if (typeof column.tag != 'undefined') if (typeof column.tag != 'undefined')
v = m(column.tag, v) v = m(column.tag, v)


return m(`td${column.class || ''}`, v)
if (typeof column.producer == 'function')
v = column.producer(v)

return m(`td${column.class || ''}`, {style: column.style || undefined}, v)
}) })
]))) : m('', 'Empty') ]))) : m('', 'Empty')
]), ]),


Loading…
Cancel
Save