fix: some ts type error

pull/3131/head^2
tangjinzhou 2020-11-07 15:08:42 +08:00
parent c52cc02e89
commit bd1f42a5ef
9 changed files with 11 additions and 13 deletions

View File

@ -9,6 +9,7 @@ import {
ExtractPropTypes, ExtractPropTypes,
onMounted, onMounted,
onBeforeUnmount, onBeforeUnmount,
Plugin,
} from 'vue'; } from 'vue';
import warning from '../_util/warning'; import warning from '../_util/warning';
import ResponsiveObserve, { import ResponsiveObserve, {

View File

@ -213,7 +213,7 @@ const components = [
const install = function(app: App) { const install = function(app: App) {
components.forEach(component => { components.forEach(component => {
app.use(component as typeof component & { install: () => void }); app.use(component);
}); });
app.config.globalProperties.$message = message; app.config.globalProperties.$message = message;

View File

@ -5,6 +5,7 @@ import interopDefault from '../_util/interopDefault';
import { ModalLocale, changeConfirmLocale } from '../modal/locale'; import { ModalLocale, changeConfirmLocale } from '../modal/locale';
import warning from '../_util/warning'; import warning from '../_util/warning';
import { getSlot } from '../_util/props-util'; import { getSlot } from '../_util/props-util';
import { withInstall } from '../_util/type';
export interface Locale { export interface Locale {
locale: string; locale: string;
Pagination?: Object; Pagination?: Object;
@ -88,4 +89,4 @@ LocaleProvider.install = function(app: App) {
return app; return app;
}; };
export default LocaleProvider; export default withInstall(LocaleProvider);

View File

@ -1,4 +1,4 @@
import { App, defineComponent, ExtractPropTypes, inject } from 'vue'; import { App, defineComponent, ExtractPropTypes, inject, Plugin } from 'vue';
import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined';
import CheckOutlined from '@ant-design/icons-vue/CheckOutlined'; import CheckOutlined from '@ant-design/icons-vue/CheckOutlined';
import PropTypes, { withUndefined } from '../_util/vue-types'; import PropTypes, { withUndefined } from '../_util/vue-types';

View File

@ -2,7 +2,6 @@ import { App, defineComponent, Plugin } from 'vue';
import T, { defaultTableProps } from './Table'; import T, { defaultTableProps } from './Table';
import Column from './Column'; import Column from './Column';
import ColumnGroup from './ColumnGroup'; import ColumnGroup from './ColumnGroup';
import {} from './interface';
import { getOptionProps, getKey, getPropsData, getSlot } from '../_util/props-util'; import { getOptionProps, getKey, getPropsData, getSlot } from '../_util/props-util';
const Table = defineComponent({ const Table = defineComponent({

View File

@ -125,9 +125,7 @@ const SingleSelector = defineComponent<SelectorProps>({
{/* Display value */} {/* Display value */}
{!combobox.value && item && !hasTextInput.value && ( {!combobox.value && item && !hasTextInput.value && (
<span class={`${prefixCls}-selection-item`} title={title.value}> <span class={`${prefixCls}-selection-item`} title={title.value}>
<Fragment key={item.key || item.value}> <Fragment key={item.key || item.value}>{item.label}</Fragment>
{item.label}
</Fragment>
</span> </span>
)} )}

View File

@ -87,7 +87,7 @@ const List = defineComponent({
const useVirtual = computed(() => { const useVirtual = computed(() => {
const { height, itemHeight, virtual } = props; const { height, itemHeight, virtual } = props;
return !!(virtual !== false && height && itemHeight); return !!(virtual !== false && height && itemHeight);
}) });
const inVirtual = computed(() => { const inVirtual = computed(() => {
const { height, itemHeight, data } = props; const { height, itemHeight, data } = props;
return useVirtual.value && data && itemHeight * data.length > height; return useVirtual.value && data && itemHeight * data.length > height;
@ -327,7 +327,7 @@ const List = defineComponent({
setInstance, setInstance,
sharedConfig, sharedConfig,
scrollBarRef, scrollBarRef,
fillerInnerRef fillerInnerRef,
}; };
}, },
render() { render() {

View File

@ -1,5 +1,4 @@
declare module 'component-classes'; declare module 'component-classes';
declare module '*vc-*';
declare module 'omit.js'; declare module 'omit.js';
declare module '*.json' { declare module '*.json' {