# vue-select-item

> Vue 2 Component for selecting image from list

Latest version **0.0.7** (published 2018-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-select-item
pnpm add vue-select-item
yarn add vue-select-item
bun add vue-select-item
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2018-07-12 |
| First published | 2018-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | thisninja |
| Maintainers | thisninja |
| Keywords | vue select image, vue image select, vue image picker, vue2 image picker, vue2 image select |

## Links

- npm: https://www.npmjs.com/package/vue-select-item
- Repository: https://github.com/thisninja/vue-select-image
- Homepage: https://github.com/thisninja/vue-select-image#readme
- Issues: https://github.com/thisninja/vue-select-image/issues
- npm.io page: https://npm.io/package/vue-select-item

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.16

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2018-07-12
- 0.0.6 — 2018-07-12
- 0.0.5 — 2018-07-11
- 0.0.4 — 2018-07-11
- 0.0.3 — 2018-07-11
- 0.0.2 — 2018-07-11
- 0.0.1 — 2018-07-11

## README

# :white_check_mark: Vue Select Item

> Vue 2.x component for selecting images from list


## Installation

```bash
# Yarn
yarn add vue-select-item

# NPM
npm i vue-select-item --save
```

## How to use

### Import

```javascript
import VueSelectItem from 'vue-select-item'
// add stylesheet
require('vue-select-item/dist/vue-select-image.css')
```

### Register components

```javascript
components: { VueSelectItem }
```

### Register as global component

```javascript
Vue.use(VueSelectItem)
```

### Sample Array Image

```javascript
[{
  id: '1',
  src: 'https://unsplash.it/200?random',
  alt: 'Alt Image 1',
  disabled: true // disable element selection and add [disabled] attribute to element; you can customize styles for this case
}, {
  id: '2',
  src: 'https://unsplash.it/200?random',
  alt: 'Alt Image 2'
}]
```

### Template

#### Single Selection

```html
<vue-select-item :dataImages="dataImages"
                  @onselectimage="onSelectImage">
</vue-select-item>
```

`onselectimage` will return emitted with parameter object image selected

#### Multiple Selection

```html
<vue-select-item :dataImages="dataImages"
                  :is-multiple="true"
                  :selectedImages="initialSelected"
                  @onselectmultipleimage="onSelectMultipleImage">
</vue-select-item>
```

`onselectmultipleimage` will return emitted with parameter list of object images selected

### Available Props

| Attribute       | Type             | Default          | Description                          	|
|-----------------|------------------|------------------|--------------------------------------	|
| :dataImages     | Array            | []               | Array of images that will be shown    |
| :selectedImages | Array            | []               | Array of initial selected images      |
| :isMultiple     | Boolean          | false            | Flag to enable multiple selection     |
| :useCheckMark   | Boolean          | false          | Flag to enable checkmark element       |
| :useLabel       | Boolean          | false            | Flag to enable showing alt as label   |
| :rootClass      | String           | vue-select-item | Class for root element of this component |
| :activeClass    | String           | --selected       | Class for active state, will concat with :rootClass |
| :h              | String           | auto             | Height of images, ex: '50px'     |
| :w              | String           | auto             | Width of images, ex: '50px'      |

### Available Events

| Events Attr            | Return                                            |
|------------------------|---------------------------------------------------|
| @onselectimage         | Object image selected                             |
| @onselectmultipleimage | Array of object image has been selected           |


### Credit

Thanks for inspiration : [https://github.com/rvera/image-picker](https://github.com/rvera/image-picker)

### Contributing

If you'd like to contribute, head to the [contributing guidelines](/CONTRIBUTING.md). Inside you'll find directions for opening issues, coding standards, and notes on development.

**Hope will usefull for you all.**

created by [Irfan Maulana](https://github.com/mazipan)
modified by [thisninja](https://github.com/thisninja)

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