Skip to content

Commit a944b8f

Browse files
committed
fix: LazyLoadImage type
1 parent 8cf7523 commit a944b8f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazy-load-image-component",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "vue-lazy-load-image-component",
55
"type": "module",
66
"main": "lib/index.js",

src/components/LazyLoadImage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import type { DefineComponent } from 'vue';
12
import { ExtractPropTypes, computed, defineComponent, ref } from 'vue';
23
import LazyLoadComponent from './LazyLoadComponent.jsx';
34
import { LazyLoadImagePropsFunc } from './interface.js';
45

5-
export type LazyLoadImageProps = Partial<ExtractPropTypes<ReturnType<typeof LazyLoadImagePropsFunc>>> & HTMLImageElement
6+
export type LazyLoadImageProps = Partial<ExtractPropTypes<ReturnType<typeof LazyLoadImagePropsFunc>>> & Partial<HTMLImageElement>
67

7-
export default defineComponent({
8+
const LazyLoadImage = defineComponent({
89
name: 'LazyLoadImage',
910
compatConfig: { MODE: 3 },
1011
inheritAttrs: false,
@@ -108,3 +109,5 @@ export default defineComponent({
108109
}
109110
},
110111
});
112+
113+
export default LazyLoadImage as DefineComponent<LazyLoadImageProps>;

vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ export default defineConfig({
1010
outputDir: 'lib',
1111
staticImport: true,
1212
exclude: ['**/__tests__/**/*', '**/__mocks__/**/*'],
13-
}),vueJsx()],
13+
}), vueJsx()],
1414
build: {
1515
lib: {
1616
entry: 'src/index.ts',
1717
name: 'vue-lazy-load-image-component',
1818
fileName: 'index',
1919
formats: ['es'],
2020
},
21-
21+
2222
rollupOptions: {
23-
input:['src/index.ts','src/effects/index.css'],
23+
input: ['src/index.ts', 'src/effects/index.css'],
2424
external: ['vue'],
2525
output: {
26-
dir:'lib',
26+
dir: 'lib',
2727
globals: {
2828
vue: 'Vue'
2929
},

0 commit comments

Comments
 (0)