Browse Source

🏑 修复typescript报错语法

master
wangxiang 3 years ago
parent
commit
9b23f6e202
  1. 2
      kicc-ui/src/components/Button/src/PopConfirmButton.vue
  2. 4
      kicc-ui/src/components/ClickOutSide/src/ClickOutSide.vue
  3. 4
      kicc-ui/src/components/Container/src/LazyContainer.vue
  4. 4
      kicc-ui/src/components/Container/src/ScrollContainer.vue
  5. 2
      kicc-ui/src/components/ContextMenu/src/ContextMenu.vue
  6. 2
      kicc-ui/src/components/Markdown/src/Markdown.vue
  7. 6
      kicc-ui/src/components/Modal/src/components/ModalWrapper.vue

2
kicc-ui/src/components/Button/src/PopConfirmButton.vue

@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
const attrs = useAttrs();
//
const getBindValues = computed(() => {
const getBindValues = computed<Recordable>(() => {
return Object.assign(
{
okText: t('common.okText'),

4
kicc-ui/src/components/ClickOutSide/src/ClickOutSide.vue

@ -5,14 +5,14 @@ @@ -5,14 +5,14 @@
</template>
<script lang="ts">
import { defineComponent, ref, onMounted } from 'vue';
import { onClickOutside } from '@vueuse/core';
import { MaybeElementRef, onClickOutside } from '@vueuse/core';
export default defineComponent({
name: 'ClickOutSide',
emits: ['mounted', 'clickOutside'],
setup(_, { emit }) {
const wrap = ref<ElRef>(null);
onClickOutside(wrap, () => {
onClickOutside(wrap as MaybeElementRef, () => {
emit('clickOutside');
});

4
kicc-ui/src/components/Container/src/LazyContainer.vue

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
</template>
<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent, reactive, onMounted, ref, toRef, toRefs } from 'vue';
import {defineComponent, reactive, onMounted, ref, toRef, toRefs, Ref} from 'vue';
import { Skeleton } from 'ant-design-vue';
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
import { useIntersectionObserver } from '/@/hooks/event/useIntersectionObserver';
@ -130,7 +130,7 @@ @@ -130,7 +130,7 @@
}
}
},
root: toRef(props, 'viewport'),
root: toRef(props, 'viewport') as Ref<Element>,
});
} catch (e) {
init();

4
kicc-ui/src/components/Container/src/ScrollContainer.vue

@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
return;
}
const { start } = useScrollTo({
el: wrap,
el: wrap as HTMLElement,
to,
duration,
});
@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
}
const scrollHeight = wrap.scrollHeight as number;
const { start } = useScrollTo({
el: wrap,
el: wrap as HTMLElement,
to: scrollHeight,
});
start();

2
kicc-ui/src/components/ContextMenu/src/ContextMenu.vue

@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
onUnmounted(() => {
const el = unref(wrapRef);
el && document.body.removeChild(el);
el && document.body.removeChild(el as Element);
});
function handleAction(item: ContextMenuItem, e: MouseEvent) {

2
kicc-ui/src/components/Markdown/src/Markdown.vue

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
emits: ['change', 'get', 'update:value'],
setup(props, { attrs, emit }) {
const wrapRef = ref<ElRef>(null);
const vditorRef = ref<Nullable<Vditor>>(null);
const vditorRef = ref<Nullable<any>>(null);
const initedRef = ref(false);
const modalFn = useModalContext();

6
kicc-ui/src/components/Modal/src/components/ModalWrapper.vue

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
import { ScrollContainer } from '/@/components/Container';
import { createModalContext } from '../hooks/useModalContext';
import { useMutationObserver } from '@vueuse/core';
import {MaybeElementRef, useMutationObserver} from '@vueuse/core';
const props = {
loading: { type: Boolean },
@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
useWindowSizeFn(setModalHeight.bind(null, false));
useMutationObserver(
spinRef,
spinRef as MaybeElementRef,
() => {
setModalHeight();
},
@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
if (!modalDom) return;
const modalRect = getComputedStyle(modalDom).top;
const modalRect = getComputedStyle(modalDom as Element).top;
const modalTop = Number.parseInt(modalRect);
let maxHeight =
window.innerHeight -

Loading…
Cancel
Save