mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
7104513a84
* docs: init * docs: semantic block * docs: part of demo * docs: modal * docs: slider * docs: space * docs: all sementic * docs: clean up * chore: fix lint * chore: clean up * chore: update script * test: fix test case * test: update testcase
62 lines
1.3 KiB
TypeScript
62 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
import { EditOutlined, UserOutlined } from '@ant-design/icons';
|
|
import { Input } from 'antd';
|
|
|
|
import SemanticPreview from '../../../.dumi/components/SemanticPreview';
|
|
import useLocale from '../../../.dumi/hooks/useLocale';
|
|
|
|
const locales = {
|
|
cn: {
|
|
input: '输入框元素',
|
|
prefix: '前缀的包裹元素',
|
|
suffix: '后缀的包裹元素',
|
|
count: '文字计数元素',
|
|
},
|
|
en: {
|
|
input: 'input element',
|
|
prefix: 'prefix element',
|
|
suffix: 'suffix element',
|
|
count: 'count element',
|
|
},
|
|
};
|
|
|
|
const App: React.FC = () => {
|
|
const [locale] = useLocale(locales);
|
|
|
|
return (
|
|
<SemanticPreview
|
|
semantics={[
|
|
{
|
|
name: 'input',
|
|
desc: locale.input,
|
|
version: '5.4.0',
|
|
},
|
|
{
|
|
name: 'prefix',
|
|
desc: locale.prefix,
|
|
version: '5.4.0',
|
|
},
|
|
{
|
|
name: 'suffix',
|
|
desc: locale.suffix,
|
|
version: '5.4.0',
|
|
},
|
|
{
|
|
name: 'count',
|
|
desc: locale.count,
|
|
version: '5.4.0',
|
|
},
|
|
]}
|
|
>
|
|
<Input
|
|
prefix={<UserOutlined />}
|
|
suffix={<EditOutlined />}
|
|
showCount
|
|
defaultValue="Hello, Ant Design"
|
|
/>
|
|
</SemanticPreview>
|
|
);
|
|
};
|
|
|
|
export default App;
|