diff --git a/.dumirc.ts b/.dumirc.ts index ccf7f47df..0dd578982 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -111,6 +111,7 @@ export default defineConfig({ children: [ { title: 'Form 表单', link: '/components/form' }, { title: 'InputNumber 数字输入框', link: '/components/input-number' }, + { title: 'Select 选择器', link: '/components/select' }, ], }, { @@ -120,7 +121,7 @@ export default defineConfig({ { title: 'Descriptions 描述列表', link: '/components/descriptions' }, { title: 'Table 表格', link: '/components/table' }, { title: 'Tabs 标签页', link: '/components/tabs' }, - {title: 'Tag 标签', link: '/components/tag'}, + { title: 'Tag 标签', link: '/components/tag' }, { title: 'Tooltip 文字提示', link: '/components/tooltip' }, ], }, diff --git a/packages/design/src/select/demo/custom-tag-render.tsx b/packages/design/src/select/demo/custom-tag-render.tsx new file mode 100644 index 000000000..694b04de0 --- /dev/null +++ b/packages/design/src/select/demo/custom-tag-render.tsx @@ -0,0 +1,31 @@ +import { Select, Tag } from '@oceanbase/design'; +import React from 'react'; + +const options = ['gold', 'green', 'red', 'cyan']; + +const tagRender = props => { + const { label, value, closable, onClose } = props; + const onPreventMouseDown = (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + }; + return ( + + {label} + + ); +}; + +const App: React.FC = () => ( + <> + ({label: item, value: item}))} - /> - Input - ({ label: item, value: item }))} + /> + Input +