From bfa117bb9437cbde744dc7812ade48dec65d8d49 Mon Sep 17 00:00:00 2001 From: Bing Sun Date: Sun, 10 May 2020 23:49:20 +0800 Subject: [PATCH] Table: support producer and style in column_options --- src/components/Table.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Table.js b/src/components/Table.js index 08d643f..e5b9959 100644 --- a/src/components/Table.js +++ b/src/components/Table.js @@ -105,7 +105,10 @@ export default initial_vnode => { if (typeof column.tag != 'undefined') 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') ]),