fix: type error
parent
b5d7d582cd
commit
2d54e2124f
|
@ -37,7 +37,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
warning(
|
warning(
|
||||||
props.checked !== undefined || checkboxGroup || props.value === undefined,
|
!!(props.checked !== undefined || checkboxGroup || props.value === undefined),
|
||||||
'Checkbox',
|
'Checkbox',
|
||||||
'`value` is not validate prop, do you mean `checked`?',
|
'`value` is not validate prop, do you mean `checked`?',
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
||||||
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
import initDefaultProps from '../_util/props-util/initDefaultProps';
|
||||||
import type { Direction } from '../config-provider';
|
import type { Direction } from '../config-provider';
|
||||||
import type { VueNode } from '../_util/type';
|
import type { VueNode } from '../_util/type';
|
||||||
|
import { objectType } from '../_util/type';
|
||||||
import { canUseDocElement } from '../_util/styleChecker';
|
import { canUseDocElement } from '../_util/styleChecker';
|
||||||
import useConfigInject from '../config-provider/hooks/useConfigInject';
|
import useConfigInject from '../config-provider/hooks/useConfigInject';
|
||||||
import { getTransitionName } from '../_util/transition';
|
import { getTransitionName } from '../_util/transition';
|
||||||
|
@ -55,8 +56,8 @@ export const modalProps = () => ({
|
||||||
icon: PropTypes.any,
|
icon: PropTypes.any,
|
||||||
maskClosable: { type: Boolean, default: undefined },
|
maskClosable: { type: Boolean, default: undefined },
|
||||||
forceRender: { type: Boolean, default: undefined },
|
forceRender: { type: Boolean, default: undefined },
|
||||||
okButtonProps: Object as PropType<ButtonPropsType>,
|
okButtonProps: objectType<ButtonPropsType>(),
|
||||||
cancelButtonProps: Object as PropType<ButtonPropsType>,
|
cancelButtonProps: objectType<ButtonPropsType>(),
|
||||||
destroyOnClose: { type: Boolean, default: undefined },
|
destroyOnClose: { type: Boolean, default: undefined },
|
||||||
wrapClassName: String,
|
wrapClassName: String,
|
||||||
maskTransitionName: String,
|
maskTransitionName: String,
|
||||||
|
@ -68,8 +69,8 @@ export const modalProps = () => ({
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
zIndex: Number,
|
zIndex: Number,
|
||||||
bodyStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
bodyStyle: objectType<CSSProperties>(),
|
||||||
maskStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
|
maskStyle: objectType<CSSProperties>(),
|
||||||
mask: { type: Boolean, default: undefined },
|
mask: { type: Boolean, default: undefined },
|
||||||
keyboard: { type: Boolean, default: undefined },
|
keyboard: { type: Boolean, default: undefined },
|
||||||
wrapProps: Object,
|
wrapProps: Object,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { ExtractPropTypes, PropType } from 'vue';
|
import type { ExtractPropTypes, PropType } from 'vue';
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import type { SizeType } from '../config-provider';
|
import type { SizeType } from '../config-provider';
|
||||||
import type { LiteralUnion, VueNode } from '../_util/type';
|
import type { VueNode } from '../_util/type';
|
||||||
import type {
|
import type {
|
||||||
ChangeEventHandler,
|
ChangeEventHandler,
|
||||||
CompositionEventHandler,
|
CompositionEventHandler,
|
||||||
|
@ -56,31 +56,28 @@ export const inputProps = () => ({
|
||||||
autocomplete: String,
|
autocomplete: String,
|
||||||
type: {
|
type: {
|
||||||
type: String as PropType<
|
type: String as PropType<
|
||||||
LiteralUnion<
|
| 'button'
|
||||||
| 'button'
|
| 'checkbox'
|
||||||
| 'checkbox'
|
| 'color'
|
||||||
| 'color'
|
| 'date'
|
||||||
| 'date'
|
| 'datetime-local'
|
||||||
| 'datetime-local'
|
| 'email'
|
||||||
| 'email'
|
| 'file'
|
||||||
| 'file'
|
| 'hidden'
|
||||||
| 'hidden'
|
| 'image'
|
||||||
| 'image'
|
| 'month'
|
||||||
| 'month'
|
| 'number'
|
||||||
| 'number'
|
| 'password'
|
||||||
| 'password'
|
| 'radio'
|
||||||
| 'radio'
|
| 'range'
|
||||||
| 'range'
|
| 'reset'
|
||||||
| 'reset'
|
| 'search'
|
||||||
| 'search'
|
| 'submit'
|
||||||
| 'submit'
|
| 'tel'
|
||||||
| 'tel'
|
| 'text'
|
||||||
| 'text'
|
| 'time'
|
||||||
| 'time'
|
| 'url'
|
||||||
| 'url'
|
| 'week'
|
||||||
| 'week',
|
|
||||||
string
|
|
||||||
>
|
|
||||||
>,
|
>,
|
||||||
default: 'text',
|
default: 'text',
|
||||||
},
|
},
|
||||||
|
|
|
@ -1141,7 +1141,7 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
|
|
||||||
// It's better move to hooks but we just simply keep here
|
// It's better move to hooks but we just simply keep here
|
||||||
let draggableConfig: DraggableConfig;
|
let draggableConfig: DraggableConfig | false;
|
||||||
if (draggable) {
|
if (draggable) {
|
||||||
if (typeof draggable === 'object') {
|
if (typeof draggable === 'object') {
|
||||||
draggableConfig = draggable;
|
draggableConfig = draggable;
|
||||||
|
@ -1152,6 +1152,8 @@ export default defineComponent({
|
||||||
} else {
|
} else {
|
||||||
draggableConfig = {};
|
draggableConfig = {};
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
draggableConfig = false;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<TreeContext
|
<TreeContext
|
||||||
|
|
|
@ -293,7 +293,7 @@ export default defineComponent({
|
||||||
// ==================== Render: Drag Handler ====================
|
// ==================== Render: Drag Handler ====================
|
||||||
const renderDragHandler = () => {
|
const renderDragHandler = () => {
|
||||||
const { draggable, prefixCls } = context.value;
|
const { draggable, prefixCls } = context.value;
|
||||||
return draggable?.icon ? (
|
return draggable && draggable?.icon ? (
|
||||||
<span class={`${prefixCls}-draggable-icon`}>{draggable.icon}</span>
|
<span class={`${prefixCls}-draggable-icon`}>{draggable.icon}</span>
|
||||||
) : null;
|
) : null;
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,7 +40,7 @@ export interface TreeContextProps {
|
||||||
showIcon: boolean;
|
showIcon: boolean;
|
||||||
icon: IconType;
|
icon: IconType;
|
||||||
switcherIcon: IconType;
|
switcherIcon: IconType;
|
||||||
draggable: DraggableConfig;
|
draggable: DraggableConfig | false;
|
||||||
draggingNodeKey?: Key;
|
draggingNodeKey?: Key;
|
||||||
checkable: boolean;
|
checkable: boolean;
|
||||||
customCheckable: () => any;
|
customCheckable: () => any;
|
||||||
|
|
Loading…
Reference in New Issue