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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save