{"id":22490676,"url":"https://github.com/john015/vue-load-image","last_synced_at":"2025-09-13T12:44:09.901Z","repository":{"id":39380649,"uuid":"158507406","full_name":"john015/vue-load-image","owner":"john015","description":"A Vue component for showing loader during image loading https://john015.github.io/vue-load-image/","archived":false,"fork":false,"pushed_at":"2023-01-07T04:01:26.000Z","size":1949,"stargazers_count":66,"open_issues_count":13,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T21:22:54.458Z","etag":null,"topics":["image","image-loader","image-preloader","loader","vue","vue-components","vue-image","vue-image-loader","vue-load-image","vue3","vue3-image-loader","vuejs"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/john015.png","metadata":{"files":{"readme":"README-ko.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-21T07:23:35.000Z","updated_at":"2024-01-12T10:11:31.000Z","dependencies_parsed_at":"2023-02-06T11:16:45.472Z","dependency_job_id":null,"html_url":"https://github.com/john015/vue-load-image","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john015%2Fvue-load-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john015%2Fvue-load-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john015%2Fvue-load-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john015%2Fvue-load-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/john015","download_url":"https://codeload.github.com/john015/vue-load-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228501419,"owners_count":17930243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image","image-loader","image-preloader","loader","vue","vue-components","vue-image","vue-image-loader","vue-load-image","vue3","vue3-image-loader","vuejs"],"created_at":"2024-12-06T17:22:31.050Z","updated_at":"2024-12-06T17:25:36.443Z","avatar_url":"https://github.com/john015.png","language":"Vue","readme":"[English](./README.md) | 한국어\n\n# vue-load-image\n\n[![npm](https://img.shields.io/npm/dt/vue-load-image.svg)](https://www.npmjs.com/package/vue-load-image) ![npm bundle size (minified)](https://img.shields.io/bundlephobia/minzip/vue-load-image.svg) [![npm version](https://img.shields.io/npm/v/vue-load-image.svg?style=flat)](https://www.npmjs.com/package/vue-load-image) [![NpmLicense](https://img.shields.io/npm/l/vue-load-image.svg)](https://github.com/john015/vue-load-image/blob/master/LICENSE)\n\nvue-load-image 는 이미지로드 중 이미지 로더를 표시하며 이미지로드에 실패 했을때 대체 내용을 표시하는 1KB(gzipped size) Vue component 입니다.\n\n## Demo\n\n[vue-load-image Demo](https://john015.github.io/vue-load-image/) / [(Source Code)](https://github.com/john015/vue-load-image/tree/master/example) \n\n## Installation\n\n### Via NPM:\n\n```bash\n# for Vue 2.x\nnpm i vue-load-image \n\n# for Vue 3.x\nnpm i vue-load-image@next\n```\n\n### Via CDN:\n\n```html\n\u003c!-- for Vue 2.x --\u003e\n\u003cscript src='https://unpkg.com/vue-load-image'\u003e\u003c/script\u003e\n\n\u003c!-- for Vue 3.x --\u003e\n\u003cscript src='https://unpkg.com/vue-load-image@next'\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Image\n\n#### Vue 2.x\n\n```js\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cvue-load-image\u003e\n      \u003cimg slot=\"image\" src=\"./image.png\"/\u003e\n      \u003cimg slot=\"preloader\" src=\"./image-loader.gif\"/\u003e\n      \u003cdiv slot=\"error\"\u003eerror message\u003c/div\u003e\n    \u003c/vue-load-image\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueLoadImage from 'vue-load-image'\n\nexport default {\n  components: {\n    'vue-load-image': VueLoadImage\n  }\n}\n\u003c/script\u003e\n```\n\n#### Vue 3.x\n\n```js\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cvue-load-image\u003e\n      \u003ctemplate v-slot:image\u003e\n        \u003cimg src=\"./image.png\"/\u003e\n      \u003c/template\u003e\n      \u003ctemplate v-slot:preloader\u003e \n        \u003cimg src=\"./image-loader.gif\" /\u003e\n      \u003c/template\u003e\n      \u003ctemplate v-slot:error\u003eImage load fails\u003c/template\u003e\n    \u003c/vue-load-image\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueLoadImage from 'vue-load-image'\n\nexport default {\n  components: {\n    'vue-load-image': VueLoadImage\n  }\n}\n\u003c/script\u003e\n```\n\n### Background-image\n\n#### Vue 2.x\n\n```js\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cvue-load-image\u003e\n      \u003cdiv slot=\"image\" style=\"background-image: url(./image.png)\" data-src='./image.png' /\u003e\n      \u003cimg slot=\"preloader\" src=\"./image-loader.gif\" /\u003e\n      \u003cdiv slot=\"error\"\u003eerror message\u003c/div\u003e\n    \u003c/vue-load-image\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueLoadImage from 'vue-load-image'\n\nexport default {\n  components: {\n    'vue-load-image': VueLoadImage\n  }\n}\n\u003c/script\u003e\n```\n\n#### Vue 3.x\n\n```js\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cvue-load-image\u003e\n      \u003ctemplate v-slot:image\u003e\n        \u003cdiv style=\"background-image: url(./image.png)\" data-src='./image.png' /\u003e\n      \u003c/template\u003e\n      \u003ctemplate v-slot:preloader\u003e \n        \u003cimg src=\"./image-loader.gif\" /\u003e\n      \u003c/template\u003e\n      \u003ctemplate v-slot:error\u003eImage load fails\u003c/template\u003e\n    \u003c/vue-load-image\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueLoadImage from 'vue-load-image'\n\nexport default {\n  components: {\n    'vue-load-image': VueLoadImage\n  }\n}\n\u003c/script\u003e\n```\n\n#### ⚠️유의사항\n\ndata-src 값을 background-image url 과 동일하게 설정 해주세요.\n\n## Events\n\n| Name      | Description                                |\n| --------- | ------------------------------------------ |\n| `onError` | 이미지 로드 실패시 onError 가 호출 됩니다. |\n| `onLoad`  | 이미지가 로드되면 onLoad 가 호출 됩니다.   |\n\n## Slots\n\n이미지가 성공적으로 로드 되면 \"image\" slot 이 렌더링 됩니다.\n\n이미지가 로드 중일 때 \"preloader\" slot 이 렌더링됩니다.\n\n이미지로드에 실패하면 \"error\" slot 이 렌더링됩니다.\n","funding_links":[],"categories":["UI Components [🔝](#readme)","Components \u0026 Libraries","Vue","UI Components"],"sub_categories":["UI Components","Form"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn015%2Fvue-load-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohn015%2Fvue-load-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn015%2Fvue-load-image/lists"}