🎬 update Tag demo

This commit is contained in:
afc163 2020-06-05 11:01:02 +08:00
parent 6493db80d4
commit f22c5d999b
6 changed files with 37 additions and 37 deletions

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/tag/demo/animation.md correctly 1`] = ` exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
<div> Array [
<div <div
style="margin-bottom:16px" style="margin-bottom:16px"
> >
@ -97,7 +97,7 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
</span> </span>
</span> </span>
</div> </div>
</div> </div>,
<span <span
class="ant-tag site-tag-plus" class="ant-tag site-tag-plus"
> >
@ -126,17 +126,17 @@ exports[`renders ./components/tag/demo/animation.md correctly 1`] = `
</svg> </svg>
</span> </span>
New Tag New Tag
</span> </span>,
</div> ]
`; `;
exports[`renders ./components/tag/demo/basic.md correctly 1`] = ` exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
<div> Array [
<span <span
class="ant-tag" class="ant-tag"
> >
Tag 1 Tag 1
</span> </span>,
<span <span
class="ant-tag" class="ant-tag"
> >
@ -145,7 +145,7 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
> >
Link Link
</a> </a>
</span> </span>,
<span <span
class="ant-tag" class="ant-tag"
> >
@ -171,7 +171,7 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
/> />
</svg> </svg>
</span> </span>
</span> </span>,
<span <span
class="ant-tag" class="ant-tag"
> >
@ -197,8 +197,8 @@ exports[`renders ./components/tag/demo/basic.md correctly 1`] = `
/> />
</svg> </svg>
</span> </span>
</span> </span>,
</div> ]
`; `;
exports[`renders ./components/tag/demo/checkable.md correctly 1`] = ` exports[`renders ./components/tag/demo/checkable.md correctly 1`] = `
@ -340,14 +340,14 @@ Array [
`; `;
exports[`renders ./components/tag/demo/control.md correctly 1`] = ` exports[`renders ./components/tag/demo/control.md correctly 1`] = `
<div> Array [
<span <span
class="ant-tag edit-tag" class="ant-tag edit-tag"
> >
<span> <span>
Unremovable Unremovable
</span> </span>
</span> </span>,
<span <span
class="ant-tag edit-tag" class="ant-tag edit-tag"
> >
@ -375,7 +375,7 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
/> />
</svg> </svg>
</span> </span>
</span> </span>,
<span <span
class="ant-tag edit-tag" class="ant-tag edit-tag"
> >
@ -403,7 +403,7 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
/> />
</svg> </svg>
</span> </span>
</span> </span>,
<span <span
class="ant-tag site-tag-plus" class="ant-tag site-tag-plus"
> >
@ -432,12 +432,12 @@ exports[`renders ./components/tag/demo/control.md correctly 1`] = `
</svg> </svg>
</span> </span>
New Tag New Tag
</span> </span>,
</div> ]
`; `;
exports[`renders ./components/tag/demo/controlled.md correctly 1`] = ` exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
<div> Array [
<span <span
class="ant-tag" class="ant-tag"
> >
@ -463,8 +463,8 @@ exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
/> />
</svg> </svg>
</span> </span>
</span> </span>,
<br /> <br />,
<button <button
class="ant-btn ant-btn-sm" class="ant-btn ant-btn-sm"
type="button" type="button"
@ -472,12 +472,12 @@ exports[`renders ./components/tag/demo/controlled.md correctly 1`] = `
<span> <span>
Toggle Toggle
</span> </span>
</button> </button>,
</div> ]
`; `;
exports[`renders ./components/tag/demo/icon.md correctly 1`] = ` exports[`renders ./components/tag/demo/icon.md correctly 1`] = `
<div> Array [
<span <span
class="ant-tag ant-tag-has-color" class="ant-tag ant-tag-has-color"
style="background-color:#55acee" style="background-color:#55acee"
@ -505,7 +505,7 @@ exports[`renders ./components/tag/demo/icon.md correctly 1`] = `
<span> <span>
Twitter Twitter
</span> </span>
</span> </span>,
<span <span
class="ant-tag ant-tag-has-color" class="ant-tag ant-tag-has-color"
style="background-color:#cd201f" style="background-color:#cd201f"
@ -533,7 +533,7 @@ exports[`renders ./components/tag/demo/icon.md correctly 1`] = `
<span> <span>
Youtube Youtube
</span> </span>
</span> </span>,
<span <span
class="ant-tag ant-tag-has-color" class="ant-tag ant-tag-has-color"
style="background-color:#3b5999" style="background-color:#3b5999"
@ -561,7 +561,7 @@ exports[`renders ./components/tag/demo/icon.md correctly 1`] = `
<span> <span>
Facebook Facebook
</span> </span>
</span> </span>,
<span <span
class="ant-tag ant-tag-has-color" class="ant-tag ant-tag-has-color"
style="background-color:#55acee" style="background-color:#55acee"
@ -589,8 +589,8 @@ exports[`renders ./components/tag/demo/icon.md correctly 1`] = `
<span> <span>
LinkedIn LinkedIn
</span> </span>
</span> </span>,
</div> ]
`; `;
exports[`renders ./components/tag/demo/status.md correctly 1`] = ` exports[`renders ./components/tag/demo/status.md correctly 1`] = `

View File

@ -78,7 +78,7 @@ class EditableTagGroup extends React.Component {
const { tags, inputVisible, inputValue } = this.state; const { tags, inputVisible, inputValue } = this.state;
const tagChild = tags.map(this.forMap); const tagChild = tags.map(this.forMap);
return ( return (
<div> <>
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<TweenOneGroup <TweenOneGroup
enter={{ enter={{
@ -113,7 +113,7 @@ class EditableTagGroup extends React.Component {
<PlusOutlined /> New Tag <PlusOutlined /> New Tag
</Tag> </Tag>
)} )}
</div> </>
); );
} }
} }

View File

@ -26,7 +26,7 @@ function preventDefault(e) {
} }
ReactDOM.render( ReactDOM.render(
<div> <>
<Tag>Tag 1</Tag> <Tag>Tag 1</Tag>
<Tag> <Tag>
<a href="https://github.com/ant-design/ant-design/issues/1862">Link</a> <a href="https://github.com/ant-design/ant-design/issues/1862">Link</a>
@ -37,7 +37,7 @@ ReactDOM.render(
<Tag closable onClose={preventDefault}> <Tag closable onClose={preventDefault}>
Prevent Default Prevent Default
</Tag> </Tag>
</div>, </>,
mountNode, mountNode,
); );
``` ```

View File

@ -78,7 +78,7 @@ class EditableTagGroup extends React.Component {
render() { render() {
const { tags, inputVisible, inputValue, editInputIndex, editInputValue } = this.state; const { tags, inputVisible, inputValue, editInputIndex, editInputValue } = this.state;
return ( return (
<div> <>
{tags.map((tag, index) => { {tags.map((tag, index) => {
if (editInputIndex === index) { if (editInputIndex === index) {
return ( return (
@ -143,7 +143,7 @@ class EditableTagGroup extends React.Component {
<PlusOutlined /> New Tag <PlusOutlined /> New Tag
</Tag> </Tag>
)} )}
</div> </>
); );
} }
} }

View File

@ -23,7 +23,7 @@ class Demo extends React.Component {
render() { render() {
return ( return (
<div> <>
<Tag <Tag
closable closable
visible={this.state.visible} visible={this.state.visible}
@ -35,7 +35,7 @@ class Demo extends React.Component {
<Button size="small" onClick={() => this.setState({ visible: !this.state.visible })}> <Button size="small" onClick={() => this.setState({ visible: !this.state.visible })}>
Toggle Toggle
</Button> </Button>
</div> </>
); );
} }
} }

View File

@ -27,7 +27,7 @@ import {
} from '@ant-design/icons'; } from '@ant-design/icons';
ReactDOM.render( ReactDOM.render(
<div> <>
<Tag icon={<TwitterOutlined />} color="#55acee"> <Tag icon={<TwitterOutlined />} color="#55acee">
Twitter Twitter
</Tag> </Tag>
@ -40,7 +40,7 @@ ReactDOM.render(
<Tag icon={<LinkedinOutlined />} color="#55acee"> <Tag icon={<LinkedinOutlined />} color="#55acee">
LinkedIn LinkedIn
</Tag> </Tag>
</div>, </>,
mountNode, mountNode,
); );
``` ```