parent
1503364d6b
commit
d7426e11d4
@ -1,15 +0,0 @@
|
||||
import PropTypes, { withUndefined } from '../_util/vue-types';
|
||||
export default () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
type: PropTypes.string,
|
||||
htmlType: PropTypes.oneOf(['button', 'submit', 'reset']).def('button'),
|
||||
// icon: PropTypes.string,
|
||||
shape: PropTypes.oneOf(['circle', 'circle-outline', 'round']),
|
||||
size: PropTypes.oneOf(['small', 'large', 'default']).def('default'),
|
||||
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
|
||||
disabled: PropTypes.looseBool,
|
||||
ghost: PropTypes.looseBool,
|
||||
block: PropTypes.looseBool,
|
||||
icon: PropTypes.any,
|
||||
onClick: PropTypes.func,
|
||||
});
|
@ -0,0 +1,26 @@
|
||||
import { tuple } from '../_util/type';
|
||||
import PropTypes, { withUndefined } from '../_util/vue-types';
|
||||
|
||||
const ButtonTypes = tuple('default', 'primary', 'ghost', 'dashed', 'danger', 'link');
|
||||
export type ButtonType = typeof ButtonTypes[number];
|
||||
const ButtonShapes = tuple('circle', 'circle-outline', 'round');
|
||||
export type ButtonShape = typeof ButtonShapes[number];
|
||||
const ButtonSizes = tuple('large', 'default', 'small');
|
||||
export type ButtonSize = typeof ButtonSizes[number];
|
||||
const ButtonHTMLTypes = tuple('submit', 'button', 'reset');
|
||||
export type ButtonHTMLType = typeof ButtonHTMLTypes[number];
|
||||
|
||||
export default () => ({
|
||||
prefixCls: PropTypes.string,
|
||||
type: PropTypes.oneOf(ButtonTypes),
|
||||
htmlType: PropTypes.oneOf(ButtonHTMLTypes).def('button'),
|
||||
// icon: PropTypes.string,
|
||||
shape: PropTypes.oneOf(ButtonShapes),
|
||||
size: PropTypes.oneOf(ButtonSizes).def('default'),
|
||||
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
|
||||
disabled: PropTypes.looseBool,
|
||||
ghost: PropTypes.looseBool,
|
||||
block: PropTypes.looseBool,
|
||||
icon: PropTypes.VNodeChild,
|
||||
onClick: PropTypes.func,
|
||||
});
|
@ -1,10 +1,11 @@
|
||||
import { App } from 'vue';
|
||||
import Button from './button';
|
||||
import ButtonGroup from './button-group';
|
||||
|
||||
Button.Group = ButtonGroup;
|
||||
|
||||
/* istanbul ignore next */
|
||||
Button.install = function(app) {
|
||||
Button.install = function(app: App) {
|
||||
app.component(Button.name, Button);
|
||||
app.component(ButtonGroup.name, ButtonGroup);
|
||||
};
|
Loading…
Reference in new issue