-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathPreviewDemo.tsx
35 lines (31 loc) · 908 Bytes
/
PreviewDemo.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import type { CSSProperties, PropType } from 'vue';
import { defineComponent, toRefs } from 'vue';
import { antdComponents } from './component-panel';
import type { Theme } from './interface';
import ComponentDemoPro from './token-panel-pro/ComponentDemoPro';
export type PreviewDemoProps = {
theme: Theme;
};
const PreviewDemo = defineComponent({
name: 'PreviewDemo',
props: {
theme: { type: Object as PropType<Theme> },
},
setup(props, { attrs }) {
const { theme } = toRefs(props);
return () => {
return (
<div {...attrs} style={{ ...(attrs.style as CSSProperties), overflow: 'auto' }}>
<ComponentDemoPro
theme={theme.value}
components={antdComponents}
componentDrawer={false}
showAll
style={{ minHeight: '100%' }}
/>
</div>
);
};
},
});
export default PreviewDemo;