Skip to content

Commit c1ad286

Browse files
committed
feat: 添加图像组件及相关样式,更新依赖项
1 parent f6e7a25 commit c1ad286

File tree

13 files changed

+647
-70
lines changed

13 files changed

+647
-70
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
## v0.0.4
54

65
[compare changes](https://github.com/iceywu/uni-ui-plus/compare/v0.0.3...v0.0.4)
@@ -39,4 +38,3 @@
3938
- IceyWu ([@Life-Palette](http://github.com/Life-Palette))
4039

4140
## v0.0.2
42-

components/button/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.up-btn {
2-
}
2+
}

components/image/image.ts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import type { ImageProps as ImagePropsType } from "@uni-helper/uni-app-types";
2+
import type { ExtractPropTypes, PropType } from "vue";
3+
import type { LoadingMode } from "./type";
4+
import { makeStringProp } from "../_utils";
5+
6+
interface ImgProps {
7+
file: string;
8+
fileType: string;
9+
thumbnail: string;
10+
videoSrc: string;
11+
blurhash?: string | undefined;
12+
cover?: string;
13+
preSrc?: string;
14+
alt?: string;
15+
src?: string;
16+
baseSrc?: string;
17+
}
18+
19+
interface ErrorConfig {
20+
open: boolean;
21+
errSrc: string;
22+
}
23+
24+
// 定义 props
25+
export const imageProps = {
26+
/**
27+
* @description 表单类型,可选值为 `LoadingMode` 类型中定义的值,默认值为 'default'
28+
*/
29+
loadingMode: makeStringProp<LoadingMode>("blurhash"),
30+
/**
31+
* @description 是否禁用刷新功能
32+
* @default false
33+
*/
34+
isDisabledRefresh: {
35+
type: Boolean,
36+
default: false,
37+
},
38+
39+
/**
40+
* @description
41+
*/
42+
imageProps: {
43+
type: Object as PropType<
44+
Partial<Omit<ImagePropsType, "loading" | "finished" | "onLoad">>
45+
>,
46+
default: () => ({
47+
lazyLoad: true,
48+
mode: "widthFix",
49+
}),
50+
},
51+
data: {
52+
type: Object as PropType<ImgProps>,
53+
default: () => ({}),
54+
},
55+
width: {
56+
// type: [String, Number],
57+
type: String,
58+
default: "100%",
59+
},
60+
height: {
61+
// type: [String, Number],
62+
type: String,
63+
default: "100%",
64+
},
65+
isShowBase: {
66+
type: Boolean,
67+
default: false,
68+
},
69+
resize: {
70+
type: Number,
71+
default: 0,
72+
},
73+
delay: {
74+
type: Number,
75+
default: 500,
76+
},
77+
borderRadius: {
78+
// type: [String, Number],
79+
type: Number,
80+
default: 0,
81+
},
82+
minHeight: {
83+
// type: [String, Number],
84+
type: String,
85+
default: "200rpx",
86+
},
87+
errConfig: {
88+
type: Object as PropType<ErrorConfig>,
89+
default: () => ({
90+
open: false,
91+
errSrc: "",
92+
}),
93+
},
94+
placeholder: {
95+
type: String,
96+
default: "",
97+
},
98+
src: {
99+
type: String,
100+
default: "",
101+
},
102+
isLpPreset: {
103+
type: Boolean,
104+
default: false,
105+
},
106+
} as const;
107+
108+
export type ImageProps = ExtractPropTypes<typeof imageProps>;
109+
110+
// 定义 emits
111+
export interface ImageEmits {
112+
(e: "onRefresh"): any;
113+
}

0 commit comments

Comments
 (0)