[English](./README.md) | 한국어
# vue-load-image
[](https://www.npmjs.com/package/vue-load-image)  [](https://www.npmjs.com/package/vue-load-image) [](https://github.com/john015/vue-load-image/blob/master/LICENSE)
vue-load-image 는 이미지로드 중 이미지 로더를 표시하며 이미지로드에 실패 했을때 대체 내용을 표시하는 1KB(gzipped size) Vue component 입니다.
## Demo
[vue-load-image Demo](https://john015.github.io/vue-load-image/) / [(Source Code)](https://github.com/john015/vue-load-image/tree/master/example)
## Installation
### Via NPM:
```bash
# for Vue 2.x
npm i vue-load-image
# for Vue 3.x
npm i vue-load-image@next
```
### Via CDN:
```html
```
## Usage
### Image
#### Vue 2.x
```js
error message
```
#### Vue 3.x
```js
Image load fails
```
### Background-image
#### Vue 2.x
```js
error message
```
#### Vue 3.x
```js
Image load fails
```
#### ⚠️유의사항
data-src 값을 background-image url 과 동일하게 설정 해주세요.
## Events
| Name | Description |
| --------- | ------------------------------------------ |
| `onError` | 이미지 로드 실패시 onError 가 호출 됩니다. |
| `onLoad` | 이미지가 로드되면 onLoad 가 호출 됩니다. |
## Slots
이미지가 성공적으로 로드 되면 "image" slot 이 렌더링 됩니다.
이미지가 로드 중일 때 "preloader" slot 이 렌더링됩니다.
이미지로드에 실패하면 "error" slot 이 렌더링됩니다.