UNPKG

1.14 kBJavaScriptView Raw
1import { tuple } from '../_util/type';
2import PropTypes from '../_util/vue-types';
3var ButtonTypes = tuple('default', 'primary', 'ghost', 'dashed', 'link', 'text');
4var ButtonShapes = tuple('default', 'circle', 'round');
5var ButtonHTMLTypes = tuple('submit', 'button', 'reset');
6export function convertLegacyProps(type) {
7 if (type === 'danger') {
8 return {
9 danger: true
10 };
11 }
12
13 return {
14 type: type
15 };
16}
17export var buttonProps = function buttonProps() {
18 return {
19 prefixCls: PropTypes.string,
20 type: PropTypes.oneOf(ButtonTypes),
21 htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),
22 shape: PropTypes.oneOf(ButtonShapes),
23 size: {
24 type: String
25 },
26 loading: {
27 type: [Boolean, Object],
28 default: function _default() {
29 return false;
30 }
31 },
32 disabled: PropTypes.looseBool,
33 ghost: PropTypes.looseBool,
34 block: PropTypes.looseBool,
35 danger: PropTypes.looseBool,
36 icon: PropTypes.any,
37 href: PropTypes.string,
38 target: PropTypes.string,
39 title: PropTypes.string,
40 onClick: {
41 type: Function
42 }
43 };
44};
45export default buttonProps;
\No newline at end of file