# ofa-img-onerror

> Vue directive that deal with img onerror

Latest version **0.2.0** (published 2019-12-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install ofa-img-onerror
pnpm add ofa-img-onerror
yarn add ofa-img-onerror
bun add ofa-img-onerror
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-12-04 |
| First published | 2019-12-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | FoxDaxian |
| Maintainers | cnfox |
| Keywords | vue, vue-directive, img, onerror |

## Links

- npm: https://www.npmjs.com/package/ofa-img-onerror
- Repository: https://github.com/FoxDaxian/oneForAll
- Issues: https://github.com/FoxDaxian/oneForAll/issues
- npm.io page: https://npm.io/package/ofa-img-onerror

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2019-12-04
- 0.1.0 — 2019-12-04

## README

# `img-onerror`

> handle image tag error enent.

## Usage

```javascript
// main file
const imgOnerror = require('ofa-img-onerror');
// or
// import imgOnerror from 'ofa-img-onerror';


Vue.use(imgOnerror);

// business files

<img
    src="/error.png"
    v-imgOnerror="
        'https://raw.githubusercontent.com/FoxDaxian/FoxDaxian.github.io/master/assets/picgo/20191201163946.jpg'
    "
    alt="alt"
/>

```

### success demo

> like this below, img-onerror will add classname `imgOnerror`

![](https://raw.githubusercontent.com/FoxDaxian/FoxDaxian.github.io/master/assets/picgo/20191204103849.png)


### error demo

> like this below, img-onerror will add classname `imgOnerror-error`

![](https://raw.githubusercontent.com/FoxDaxian/FoxDaxian.github.io/master/assets/picgo/20191204104334.png)



> For to meet different business, you can custom style use different classname

---
_Source: https://npm.io/package/ofa-img-onerror · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
