Browse Source

fix: type error

pull/7242/head^2 4.1.0
tangjinzhou 11 months ago
parent
commit
2eed8e62ec
  1. 8
      components/_util/cssinjs/hooks/useStyleRegister/index.tsx
  2. 2
      components/_util/type.ts
  3. 2
      components/menu/src/hooks/useMenuContext.ts
  4. 6
      components/vc-picker/panels/TimePanel/TimeUnitColumn.tsx
  5. 1
      package.json

8
components/_util/cssinjs/hooks/useStyleRegister/index.tsx

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

2
components/_util/type.ts

@ -33,7 +33,7 @@ export interface PropOptions<T = any, D = T> {
declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
// 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) => {
const c = comp as any;

2
components/menu/src/hooks/useMenuContext.ts

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

6
components/vc-picker/panels/TimePanel/TimeUnitColumn.tsx

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

1
package.json

@ -129,7 +129,6 @@
"@vitejs/plugin-vue-jsx": "^2.0.0",
"@vue/babel-plugin-jsx": "^1.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-typescript": "^11.0.0",
"@vue/test-utils": "^2.0.2",

Loading…
Cancel
Save