fix(Image): ImagePosition type is not exported before (#12549)

This commit is contained in:
Jungzl 2024-01-10 10:20:28 +08:00 committed by GitHub
parent 7b1a4fc0a7
commit dbf8027c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 12 deletions

View File

@ -64,6 +64,7 @@
"@vitest/coverage-istanbul": "^1.1.3", "@vitest/coverage-istanbul": "^1.1.3",
"@vue/runtime-core": "^3.4.0-rc.1", "@vue/runtime-core": "^3.4.0-rc.1",
"@vue/test-utils": "^2.3.2", "@vue/test-utils": "^2.3.2",
"csstype": "^3.1.3",
"diffable-html": "^5.0.0", "diffable-html": "^5.0.0",
"jsdom": "^22.1.0", "jsdom": "^22.1.0",
"typescript": "^5.0.4", "typescript": "^5.0.4",

View File

@ -29,15 +29,8 @@ import { Icon } from '../icon';
const [name, bem] = createNamespace('image'); const [name, bem] = createNamespace('image');
export type ImageFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down'; // Types
import type { ImageFit, ImagePosition } from './types';
export type ImagePosition =
| 'center'
| 'top'
| 'right'
| 'bottom'
| 'left'
| string;
export const imageProps = { export const imageProps = {
src: String, src: String,

View File

@ -4,8 +4,8 @@ import _Image from './Image';
export const Image = withInstall(_Image); export const Image = withInstall(_Image);
export default Image; export default Image;
export { imageProps } from './Image'; export { imageProps } from './Image';
export type { ImageFit, ImageProps } from './Image'; export type { ImageProps } from './Image';
export type { ImageThemeVars } from './types'; export type { ImageFit, ImagePosition, ImageThemeVars } from './types';
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {

View File

@ -1,3 +1,9 @@
import type { CSSProperties } from 'vue';
export type ImageFit = CSSProperties['objectFit'];
export type ImagePosition = CSSProperties['objectPosition'];
export type ImageThemeVars = { export type ImageThemeVars = {
imagePlaceholderTextColor?: string; imagePlaceholderTextColor?: string;
imagePlaceholderFontSize?: string; imagePlaceholderFontSize?: string;

View File

@ -3,7 +3,7 @@
"compilerOptions": { "compilerOptions": {
"allowJs": true, "allowJs": true,
"noImplicitThis": true, "noImplicitThis": true,
"types": ["vitest/globals", "vue/jsx"] "types": ["vitest/globals", "vue/jsx", "csstype"]
}, },
"include": ["src/**/*", "docs/**/*", "test/**/*"], "include": ["src/**/*", "docs/**/*", "test/**/*"],
"exclude": ["**/node_modules", "**/.*/"] "exclude": ["**/node_modules", "**/.*/"]

3
pnpm-lock.yaml generated
View File

@ -100,6 +100,9 @@ importers:
'@vue/test-utils': '@vue/test-utils':
specifier: ^2.3.2 specifier: ^2.3.2
version: 2.4.1(vue@3.4.0-rc.1) version: 2.4.1(vue@3.4.0-rc.1)
csstype:
specifier: ^3.1.3
version: 3.1.3
diffable-html: diffable-html:
specifier: ^5.0.0 specifier: ^5.0.0
version: 5.0.0 version: 5.0.0