File tree 8 files changed +59
-38
lines changed
fighting-components/image/src 8 files changed +59
-38
lines changed Original file line number Diff line number Diff line change 5
5
** fix**
6
6
7
7
- 修复 ` FImage ` 组件旋转方向一致的问题
8
+ - 修复 ` FIcon ` 组件预览窗操作点击失效问题,处理点击焦点位置
8
9
- 修复 ` FIcon ` 、` FButton ` 组件的类型问题
9
10
- ` FImage ` 组件的 ` select ` 属性改为 ` no-select ` 用于禁止选择
10
11
17
18
- 新增 ` FImage ` 组件预览图左右按钮切换加入图片长度识别,是否展示效果
18
19
- 新增 ` FImage ` 组件 ` show-close-btn ` 配置项可配置是否展示预览窗的关闭按钮
19
20
- 新增 ` FImage ` 组件可通过鼠标滚轮放大缩小图片功能
21
+ - 新增 ` FImage ` 组件 ` preview-round ` 配置项,可配置预览图的圆角
20
22
21
23
## 0.0.5 beta.5 (2022-05-27)
22
24
Original file line number Diff line number Diff line change 190
190
| fit | 如何适应容器,原生 [ object-fit] ( https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit#try_it ) 属性 | string | ` fill ` ` contain ` ` cover ` ` none ` ` scale-down ` | —— |
191
191
| no-select | 是否禁止选择 | boolean | —— | false |
192
192
| referrer-policy | 原生 [ referrerPolicy] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#syntax ) 属性 | string | —— | —— |
193
- | preview-list | 开启图片预览 | string[ ] | —— | [ ] |
194
- | preview-show-index | 图片预览展示的首张图的索引,从 0 开始 | number | —— | 0 |
195
- | preview-z-index | 图片预览展示的 [ z-index] ( https://developer.mozilla.org/zh-CN/docs/Web/CSS/z-index ) | number | —— | 999 |
196
- | preview-show-option | 是否展示图片预览下面的操作栏 | boolean | —— | true |
197
193
| round | 配置圆角,传入一个单位 | string | —— | —— |
198
194
| err-src | 加载失败时要显示的地址 | string | —— | —— |
199
195
| caption | 图片上的说明文字 | string | —— | —— |
200
196
| caption-color | 图片上的说明文字的颜色 | string | —— | #fff |
201
197
| modal-close | 是否点击遮罩层关闭预览窗 | boolean | —— | true |
202
198
| show-close-btn | 是否展示预览窗口的关闭按钮 | boolean | —— | true |
199
+ | preview-list | 开启图片预览 | string[ ] | —— | [ ] |
200
+ | preview-show-index | 图片预览展示的首张图的索引,从 0 开始 | number | —— | 0 |
201
+ | preview-z-index | 图片预览展示的 [ z-index] ( https://developer.mozilla.org/zh-CN/docs/Web/CSS/z-index ) | number | —— | 999 |
202
+ | preview-show-option | 是否展示图片预览下面的操作栏 | boolean | —— | true |
203
+ | preview-round | 预览图的圆角 ,传入一个单位 | string | —— | —— |
203
204
204
205
## Events
205
206
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { PropType } from 'vue'
2
2
3
3
export const Props = {
4
4
previewList : {
5
- type : Array as PropType < string [ ] > ,
5
+ type : Array as PropType < Array < string > > ,
6
6
default : ( ) : [ ] => [ ]
7
7
} ,
8
8
previewShowIndex : {
@@ -24,6 +24,10 @@ export const Props = {
24
24
showCloseBtn : {
25
25
type : Boolean ,
26
26
default : ( ) : boolean => true
27
+ } ,
28
+ previewRound : {
29
+ type : String ,
30
+ default : ( ) : string => ''
27
31
}
28
32
} as const
29
33
Original file line number Diff line number Diff line change 10
10
class =" f-image-showImg"
11
11
draggable =" false"
12
12
:src =" previewList[previewShowIndex]"
13
- :style =" { transform: `scale(${scale}) rotate(${rotate}deg)` }"
13
+ :style =" {
14
+ transform: `scale(${scale}) rotate(${rotate}deg)`,
15
+ borderRadius: previewRound
16
+ }"
14
17
/>
15
18
16
- <div v-if = " previewList.length > 1 " class = " right_button " >
17
- < f-icon
18
- size = " 30px "
19
- icon = " f-icon-arrow-right "
20
- @click = " switchImage('next') "
21
- />
19
+ <div
20
+ v-if = " previewList.length > 1 "
21
+ class = " right_button "
22
+ @click = " switchImage('next') "
23
+ >
24
+ < f-icon size = " 30px " icon = " f-icon-arrow-right " />
22
25
</div >
23
26
24
- <div v-if = " previewList.length > 1 " class = " left_button " >
25
- < f-icon
26
- size = " 30px "
27
- icon = " f-icon-arrow-left "
28
- @click = " switchImage('prev') "
29
- />
27
+ <div
28
+ v-if = " previewList.length > 1 "
29
+ class = " left_button "
30
+ @click = " switchImage('prev') "
31
+ >
32
+ < f-icon size = " 30px " icon = " f-icon-arrow-left " />
30
33
</div >
31
34
32
- <div v-if =" showCloseBtn" class =" close_button" >
33
- <f-icon size =" 20px" icon =" f-icon-close" @click = " close " />
35
+ <div v-if =" showCloseBtn" class =" close_button" @click = " close " >
36
+ <f-icon size =" 20px" icon =" f-icon-close" />
34
37
</div >
35
38
36
39
<div v-if =" previewShowOption" class =" option" @click =" optionClick" >
168
171
}
169
172
170
173
const onImgMousewheel = (evt : WheelEvent ): void => {
174
+ evt .preventDefault ()
171
175
if (evt .deltaY > 1 ) {
172
176
smaller ()
173
177
return
Original file line number Diff line number Diff line change @@ -51,22 +51,6 @@ export const Props = {
51
51
type : String ,
52
52
default : ( ) : string => ''
53
53
} ,
54
- previewList : {
55
- type : Array as PropType < string [ ] > ,
56
- default : ( ) : [ ] => [ ]
57
- } ,
58
- previewShowIndex : {
59
- type : Number ,
60
- default : ( ) : number => 0
61
- } ,
62
- previewZIndex : {
63
- type : Number ,
64
- default : ( ) : number => 999
65
- } ,
66
- previewShowOption : {
67
- type : Boolean ,
68
- default : ( ) : boolean => true
69
- } ,
70
54
round : {
71
55
type : String ,
72
56
default : ( ) : string => ''
@@ -90,6 +74,26 @@ export const Props = {
90
74
showCloseBtn : {
91
75
type : Boolean ,
92
76
default : ( ) : boolean => true
77
+ } ,
78
+ previewList : {
79
+ type : Array as PropType < string [ ] > ,
80
+ default : ( ) : [ ] => [ ]
81
+ } ,
82
+ previewShowIndex : {
83
+ type : Number ,
84
+ default : ( ) : number => 0
85
+ } ,
86
+ previewZIndex : {
87
+ type : Number ,
88
+ default : ( ) : number => 999
89
+ } ,
90
+ previewShowOption : {
91
+ type : Boolean ,
92
+ default : ( ) : boolean => true
93
+ } ,
94
+ previewRound : {
95
+ type : String ,
96
+ default : ( ) : string => ''
93
97
}
94
98
} as const
95
99
Original file line number Diff line number Diff line change 39
39
:previewZIndex =" previewZIndex"
40
40
:modalClose =" modalClose"
41
41
:showCloseBtn =" showCloseBtn"
42
+ :previewRound =" previewRound"
42
43
@close =" onClose"
43
44
/>
44
45
</div >
Original file line number Diff line number Diff line change 69
69
.right_button ,
70
70
.left_button ,
71
71
.close_button {
72
- width : 54 px ;
73
- height : 54 px ;
72
+ width : 50 px ;
73
+ height : 50 px ;
74
74
background : rgba (255 , 255 , 255 , 0.5 );
75
75
border-radius : 50% ;
76
76
position : absolute ;
Original file line number Diff line number Diff line change 9
9
alt =" ada"
10
10
:preview-list =" listImg"
11
11
:select =" true"
12
+ :preview-z-index =" 10022"
13
+ :preview-show-option =" false"
14
+ round =" 20px"
15
+ preview-round =" 120px"
16
+ caption =" 回到家啊回到家萨的好时机啊的话苏家爱华打算结婚的洒酒大数据坎大哈时间坎大哈时间的撒健康大数据坎大哈事件扩大化"
12
17
:preview-show-index =" 32"
13
18
block
14
19
/>
You can’t perform that action at this time.
0 commit comments