File tree Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-lazy-load-image-component" ,
3
- "version" : " 0.0.8 " ,
3
+ "version" : " 0.0.9 " ,
4
4
"description" : " vue-lazy-load-image-component" ,
5
5
"main" : " lib/index.js" ,
6
6
"module" : " lib/index.js" ,
Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ export default defineComponent({
63
63
threshold = { props . threshold }
64
64
useIntersectionObserver = { props . useIntersectionObserver }
65
65
width = { props . width }
66
+ style = { props . style }
67
+ class = { props . class }
66
68
/>
67
69
) : (
68
70
< PlaceholderWithTracking
@@ -73,6 +75,8 @@ export default defineComponent({
73
75
threshold = { props . threshold }
74
76
useIntersectionObserver = { props . useIntersectionObserver }
75
77
width = { props . width }
78
+ style = { props . style }
79
+ class = { props . class }
76
80
/>
77
81
) ;
78
82
} ;
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ export type LazyLoadImageProps = Partial<
10
10
11
11
const LazyLoadImage = defineComponent ( {
12
12
name : 'LazyLoadImage' ,
13
- compatConfig : { MODE : 3 } ,
14
13
inheritAttrs : false ,
14
+ compatConfig : { MODE : 3 } ,
15
15
props : LazyLoadImagePropsFunc ( ) ,
16
16
setup ( props , { attrs } ) {
17
17
const loaded = ref ( false ) ;
@@ -27,7 +27,6 @@ const LazyLoadImage = defineComponent({
27
27
function getImg ( ) {
28
28
const imgProps = computed ( ( ) => {
29
29
const {
30
- class : className ,
31
30
afterLoad,
32
31
beforeLoad,
33
32
delayMethod,
@@ -41,8 +40,8 @@ const LazyLoadImage = defineComponent({
41
40
visibleByDefault,
42
41
wrapperClassName,
43
42
wrapperProps,
44
- style,
45
43
loadedClassName,
44
+ onImageError,
46
45
...imgProps
47
46
} = props ;
48
47
return imgProps ;
@@ -103,7 +102,6 @@ const LazyLoadImage = defineComponent({
103
102
</ span >
104
103
) ;
105
104
}
106
-
107
105
return ( ) => {
108
106
const lazyLoadImage = getLazyLoadImage ( ) ;
109
107
const needsWrapper = ( props . effect || props . placeholderSrc ) && ! props . visibleByDefault ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { PlaceholderWithoutTrackingPropsFunc } from './interface';
7
7
8
8
export default defineComponent ( {
9
9
name : 'PlaceholderWithoutTracking' ,
10
+ inheritAttrs : false ,
10
11
props : PlaceholderWithoutTrackingPropsFunc ( ) ,
11
12
setup ( props ) {
12
13
const placeholder = shallowRef < HTMLElement > ( ) ;
@@ -74,6 +75,7 @@ export default defineComponent({
74
75
display : 'inline-block' ,
75
76
height : `${ props . height } px` ,
76
77
width : `${ props . width } px` ,
78
+ ...props . style ,
77
79
} ;
78
80
} ) ;
79
81
return ( ) => {
Original file line number Diff line number Diff line change @@ -92,6 +92,14 @@ export const LazyLoadImagePropsFunc = () => {
92
92
} ;
93
93
94
94
export const PlaceholderWithoutTrackingPropsFunc = ( ) => ( {
95
+ style : {
96
+ type : Object as PropType < Partial < CSSProperties > > ,
97
+ default : ( ) => { } ,
98
+ } ,
99
+ class : {
100
+ type : String ,
101
+ default : '' ,
102
+ } ,
95
103
scrollPosition : {
96
104
type : Object as PropType < ScrollPosition > ,
97
105
default : null ,
You can’t perform that action at this time.
0 commit comments