Skip to content

Commit 64b51f2

Browse files
committed
chore: improve alert type
1 parent f8ada77 commit 64b51f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/alert/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import PropTypes from '../_util/vue-types';
1414
import { getTransitionProps, Transition } from '../_util/transition';
1515
import { getComponent, isValidElement, findDOMNode } from '../_util/props-util';
1616
import { defaultConfigProvider } from '../config-provider';
17+
import { tuple } from '../_util/type';
1718

1819
function noop() {}
1920

@@ -35,7 +36,7 @@ export const AlertProps = {
3536
/**
3637
* Type of Alert styles, options:`success`, `info`, `warning`, `error`
3738
*/
38-
type: PropTypes.oneOf(['success', 'info', 'warning', 'error']),
39+
type: PropTypes.oneOf(tuple('success', 'info', 'warning', 'error')),
3940
/** Whether Alert can be closed */
4041
closable: PropTypes.looseBool,
4142
/** Close text to show */
@@ -98,7 +99,7 @@ const Alert = defineComponent({
9899

99100
render() {
100101
const { prefixCls: customizePrefixCls, banner, closing, closed, $attrs } = this;
101-
const getPrefixCls = this.configProvider.getPrefixCls;
102+
const { getPrefixCls } = this.configProvider;
102103
const prefixCls = getPrefixCls('alert', customizePrefixCls);
103104

104105
let { closable, type, showIcon } = this;

0 commit comments

Comments
 (0)