fix: type error

pull/7242/head^2 4.1.0
tangjinzhou 2024-01-05 19:28:55 +08:00
parent 61c0d0cc9d
commit 2eed8e62ec
5 changed files with 9 additions and 10 deletions

View File

@ -42,17 +42,17 @@ export type CSSProperties = Omit<CSS.PropertiesFallback<number | string>, 'anima
export type CSSPropertiesWithMultiValues = { export type CSSPropertiesWithMultiValues = {
[K in keyof CSSProperties]: [K in keyof CSSProperties]:
| CSSProperties[K] | CSSProperties[K]
| Extract<CSSProperties[K], string>[] | readonly Extract<CSSProperties[K], string>[]
| { | {
[SKIP_CHECK]: boolean; [SKIP_CHECK]?: boolean;
[MULTI_VALUE]?: boolean; [MULTI_VALUE]?: boolean;
value: CSSProperties[K] | Extract<CSSProperties[K], string>[]; value: CSSProperties[K] | CSSProperties[K][];
}; };
}; };
export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject }; export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject };
type ArrayCSSInterpolation = CSSInterpolation[]; type ArrayCSSInterpolation = readonly CSSInterpolation[];
export type InterpolationPrimitive = null | undefined | boolean | number | string | CSSObject; export type InterpolationPrimitive = null | undefined | boolean | number | string | CSSObject;

View File

@ -33,7 +33,7 @@ export interface PropOptions<T = any, D = T> {
declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void; declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
export type VueNode = VNodeChildAtom | VNodeChildAtom[] | JSX.Element; export type VueNode = VNodeChildAtom | VNodeChildAtom[] | VNode;
export const withInstall = <T>(comp: T) => { export const withInstall = <T>(comp: T) => {
const c = comp as any; const c = comp as any;

View File

@ -32,7 +32,7 @@ export interface MenuContextProps {
inlineCollapsed: Ref<boolean>; inlineCollapsed: Ref<boolean>;
theme?: ComputedRef<MenuTheme>; theme?: ComputedRef<MenuTheme>;
siderCollapsed?: ComputedRef<boolean>; siderCollapsed?: Ref<boolean>;
// // Mode // // Mode
mode: Ref<MenuMode>; mode: Ref<MenuMode>;

View File

@ -1,7 +1,7 @@
import { scrollTo, waitElementReady } from '../../utils/uiUtil'; import { scrollTo, waitElementReady } from '../../utils/uiUtil';
import { useInjectPanel } from '../../PanelContext'; import { useInjectPanel } from '../../PanelContext';
import classNames from '../../../_util/classNames'; import classNames from '../../../_util/classNames';
import { ref, onBeforeUnmount, watch, defineComponent, nextTick } from 'vue'; import { ref, onBeforeUnmount, watch, defineComponent, nextTick, shallowRef } from 'vue';
export type Unit = { export type Unit = {
label: any; label: any;
@ -24,7 +24,7 @@ export default defineComponent<TimeUnitColumnProps>({
setup(props) { setup(props) {
const { open } = useInjectPanel(); const { open } = useInjectPanel();
const ulRef = ref<HTMLUListElement>(null); const ulRef = shallowRef<HTMLElement>(null);
const liRefs = ref<Map<number, HTMLElement | null>>(new Map()); const liRefs = ref<Map<number, HTMLElement | null>>(new Map());
const scrollRef = ref<Function>(); const scrollRef = ref<Function>();
@ -33,7 +33,7 @@ export default defineComponent<TimeUnitColumnProps>({
() => { () => {
const li = liRefs.value.get(props.value!); const li = liRefs.value.get(props.value!);
if (li && open.value !== false) { if (li && open.value !== false) {
scrollTo(ulRef.value!, li.offsetTop, 120); scrollTo(ulRef.value, li.offsetTop, 120);
} }
}, },
); );

View File

@ -129,7 +129,6 @@
"@vitejs/plugin-vue-jsx": "^2.0.0", "@vitejs/plugin-vue-jsx": "^2.0.0",
"@vue/babel-plugin-jsx": "^1.0.0", "@vue/babel-plugin-jsx": "^1.0.0",
"@vue/cli-plugin-eslint": "^5.0.0", "@vue/cli-plugin-eslint": "^5.0.0",
"@vue/compiler-sfc": "^3.2.0",
"@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.0", "@vue/eslint-config-typescript": "^11.0.0",
"@vue/test-utils": "^2.0.2", "@vue/test-utils": "^2.0.2",