-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathpopover-icon.tsx
More file actions
29 lines (27 loc) · 838 Bytes
/
popover-icon.tsx
File metadata and controls
29 lines (27 loc) · 838 Bytes
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
import { defineComponent } from 'vue';
import type { PropType } from 'vue';
import { PopType } from './popover-types';
import { SuccessIcon, WarningIcon, InfoIcon, ErrorIcon } from './popover-icons';
import { useNamespace } from '@devui/shared/utils';
import './popover-icon.scss';
export default defineComponent({
props: {
type: {
type: String as PropType<PopType>,
default: 'default',
},
},
setup(props) {
const ns = useNamespace('popover');
return () =>
props.type &&
props.type !== 'default' && (
<span class={ns.e('icon-wrap')}>
{props.type === 'success' && <SuccessIcon />}
{props.type === 'warning' && <WarningIcon />}
{props.type === 'info' && <InfoIcon />}
{props.type === 'error' && <ErrorIcon />}
</span>
);
},
});