Files
ant-design/components/qr-code/demo/_semantic.tsx
MadCcc 751edfc336 feat: zeroRuntime (#54334)
* 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
2025-07-22 10:20:29 +08:00

36 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;