mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-08 18:39:20 +08:00
* feat: zeroRuntime * feat: generate full style * feat: add antd.css into global css * chore: revert site change * docs: add docs * chore: update scripts * chore: add test
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import React from 'react';
|
||
import { QRCode } from 'antd';
|
||
|
||
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
|
||
import useLocale from '../../../.dumi/hooks/useLocale';
|
||
|
||
const locales = {
|
||
cn: {
|
||
root: '根元素,设置flex布局、内边距、背景色、边框、圆角和相对定位样式',
|
||
cover: '遮罩层元素,设置绝对定位、层级、背景色和加载状态覆盖样式',
|
||
},
|
||
en: {
|
||
root: 'Root element, set flex layout, padding, background color, border, border radius and relative positioning styles',
|
||
cover:
|
||
'Cover element, set absolute positioning, z-index, background color and loading state overlay styles',
|
||
},
|
||
};
|
||
|
||
const App: React.FC = () => {
|
||
const [locale] = useLocale(locales);
|
||
const value = 'https://ant.design';
|
||
return (
|
||
<SemanticPreview
|
||
componentName="QRCode"
|
||
semantics={[
|
||
{ name: 'root', desc: locale.root },
|
||
{ name: 'cover', desc: locale.cover },
|
||
]}
|
||
>
|
||
<QRCode value={value} status="loading" />
|
||
</SemanticPreview>
|
||
);
|
||
};
|
||
|
||
export default App;
|