Browse Source

💄 update table demo

pull/14631/head
afc163 6 years ago
parent
commit
305041a79d
No known key found for this signature in database GPG Key ID: 738F973FCE5C6B48
  1. 20
      components/table/__tests__/__snapshots__/demo.test.js.snap
  2. 8
      components/table/demo/basic.md

20
components/table/__tests__/__snapshots__/demo.test.js.snap

@ -259,14 +259,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
>
<span>
<div
class="ant-tag ant-tag-blue"
class="ant-tag ant-tag-green"
>
nice
NICE
</div>
<div
class="ant-tag ant-tag-blue"
class="ant-tag ant-tag-geekblue"
>
developer
DEVELOPER
</div>
</span>
</td>
@ -322,9 +322,9 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
>
<span>
<div
class="ant-tag ant-tag-blue"
class="ant-tag ant-tag-volcano"
>
loser
LOSER
</div>
</span>
</td>
@ -380,14 +380,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
>
<span>
<div
class="ant-tag ant-tag-blue"
class="ant-tag ant-tag-green"
>
cool
COOL
</div>
<div
class="ant-tag ant-tag-blue"
class="ant-tag ant-tag-geekblue"
>
teacher
TEACHER
</div>
</span>
</td>

8
components/table/demo/basic.md

@ -35,7 +35,13 @@ const columns = [{
dataIndex: 'tags',
render: tags => (
<span>
{tags.map(tag => <Tag color="blue" key={tag}>{tag}</Tag>)}
{tags.map(tag => {
let color = tag.length > 5 ? 'geekblue' : 'green';
if (tag === 'loser') {
color = 'volcano';
}
return <Tag color={color} key={tag}>{tag.toUpperCase()}</Tag>;
})}
</span>
),
}, {

Loading…
Cancel
Save