Merge branch 'next' of github.com:vueComponent/ant-design-vue into next

This commit is contained in:
tangjinzhou 2020-10-24 21:10:06 +08:00
commit 2070f702de
2 changed files with 9 additions and 28 deletions

View File

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DropdownButton should support href like Button 1`] = `
<div class="ant-btn-group ant-dropdown-button"><a href="https://ant.design" class="ant-btn ant-btn-default">
<div class="ant-btn-group ant-dropdown-button"><a class="ant-btn ant-btn-default" href="https://ant.design">
<!---->
</a>
<!----><button class="ant-dropdown-trigger ant-btn ant-btn-default" type="button">

View File

@ -1,4 +1,4 @@
import { App, defineComponent, inject, nextTick, onMounted, ref } from 'vue';
import { App, defineComponent, inject, nextTick, onMounted, ref, PropType } from 'vue';
import PropTypes from '../_util/vue-types';
import { getOptionProps } from '../_util/props-util';
import classNames from '../_util/classNames';
@ -8,28 +8,6 @@ import VcInputNumber from '../vc-input-number/src';
import { defaultConfigProvider } from '../config-provider';
import { tuple } from '../_util/type';
export interface InputNumberPropsTypes {
prefixCls?: string;
min?: number;
max?: number;
value?: number;
step?: number | string;
defaultValue?: number;
tabindex?: number;
onChange?: (value: number | undefined) => void;
disabled?: boolean;
size?: 'large' | 'small' | 'default';
formatter?: (value: number | string | undefined) => string;
parser?: (displayValue: string | undefined) => number | string;
decimalSeparator?: string;
placeholder?: string;
name?: string;
id?: string;
precision?: number;
onPressEnter?: EventHandlerNonNull;
autofocus?: boolean;
}
const InputNumberProps = {
prefixCls: PropTypes.string,
min: PropTypes.number,
@ -48,12 +26,15 @@ const InputNumberProps = {
id: PropTypes.string,
precision: PropTypes.number,
autofocus: PropTypes.looseBool,
onPressEnter: {
type: Function as PropType<EventHandlerNonNull>,
},
};
const InputNumber = defineComponent<InputNumberPropsTypes>({
const InputNumber = defineComponent({
name: 'AInputNumber',
inheritAttrs: false,
props: InputNumberProps as any,
props: InputNumberProps,
setup(props) {
const inputNumberRef = ref(null);
const focus = () => {
@ -84,7 +65,7 @@ const InputNumber = defineComponent<InputNumberPropsTypes>({
...getOptionProps(this),
...this.$attrs,
} as any;
const getPrefixCls = (this as any).configProvider.getPrefixCls;
const { getPrefixCls } = this.configProvider;
const prefixCls = getPrefixCls('input-number', customizePrefixCls);
const inputNumberClass = classNames(
@ -104,7 +85,7 @@ const InputNumber = defineComponent<InputNumberPropsTypes>({
...others,
class: inputNumberClass,
};
return <VcInputNumber {...vcInputNumberprops} ref="saveInputNumber" />;
return <VcInputNumber {...vcInputNumberprops} ref="inputNumberRef" />;
},
});