Browse Source

style: lint code

pull/7414/head
tangjinzhou 7 months ago
parent
commit
ed27700ef4
  1. 2
      components/_util/cssinjs/hooks/useCacheToken.tsx
  2. 8
      components/_util/hooks/_vueuse/_configurable.ts
  3. 4
      components/_util/hooks/_vueuse/is.ts
  4. 1
      components/tooltip/demo/arrow.vue
  5. 5
      components/vc-select/TransBtn.tsx

2
components/_util/cssinjs/hooks/useCacheToken.tsx

@ -14,7 +14,7 @@ const isPrerender = process.env.NODE_ENV === 'prerender';
// Generate different prefix to make user selector break in production env.
// This helps developer not to do style override directly on the hash id.
const hashPrefix = (!isProduction && !isPrerender) ? 'css-dev-only-do-not-override' : 'css';
const hashPrefix = !isProduction && !isPrerender ? 'css-dev-only-do-not-override' : 'css';
export interface Option<DerivativeToken, DesignToken> {
/**

8
components/_util/hooks/_vueuse/_configurable.ts

@ -28,7 +28,7 @@ export interface ConfigurableLocation {
location?: Location;
}
export const defaultWindow = isClient ? window : undefined;
export const defaultDocument = isClient ? window.document : undefined;
export const defaultNavigator = isClient ? window.navigator : undefined;
export const defaultLocation = isClient ? window.location : undefined;
export const defaultWindow = isClient ? window : undefined;
export const defaultDocument = isClient ? window.document : undefined;
export const defaultNavigator = isClient ? window.navigator : undefined;
export const defaultLocation = isClient ? window.location : undefined;

4
components/_util/hooks/_vueuse/is.ts

@ -21,8 +21,6 @@ export const rand = (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
export const isIOS =
isClient &&
window?.navigator?.userAgent &&
/iP(ad|hone|od)/.test(window.navigator.userAgent);
isClient && window?.navigator?.userAgent && /iP(ad|hone|od)/.test(window.navigator.userAgent);
export const hasOwn = <T extends object, K extends keyof T>(val: T, key: K): key is K =>
Object.prototype.hasOwnProperty.call(val, key);

1
components/tooltip/demo/arrow.vue

@ -128,6 +128,7 @@ const mergedArrow = computed(() => {
case 'hide':
return false;
case 'center':
default:
return { pointAtCenter: true };
}
});

5
components/vc-select/TransBtn.tsx

@ -1,4 +1,5 @@
import { cloneVNode, type FunctionalComponent, type PropType } from 'vue';
import { cloneVNode } from 'vue';
import type { VNode, FunctionalComponent, PropType } from 'vue';
import type { MouseEventHandler } from '../_util/EventInterface';
import type { VueNode } from '../_util/type';
import PropTypes from '../_util/vue-types';
@ -23,7 +24,7 @@ const TransBtn: TransBtnType = (props, { slots }) => {
if (typeof customizeIcon === 'function') {
icon = customizeIcon(customizeIconProps);
} else {
icon = cloneVNode(customizeIcon);
icon = cloneVNode(customizeIcon as VNode);
}
return (

Loading…
Cancel
Save