# mv-list

> a Vue plugin with multiple view mode list

Latest version **1.2.1** (published 2020-10-06) · 0 weekly downloads

## Install

```sh
npm install mv-list
pnpm add mv-list
yarn add mv-list
bun add mv-list
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2020-10-06 |
| First published | 2020-09-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 4.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Richard |
| Maintainers | td231565 |
| Keywords | Taiwan, list, multi, multiple, view |

## Links

- npm: https://www.npmjs.com/package/mv-list
- Repository: https://github.com/td231565/npm-view-list
- Homepage: https://github.com/td231565/npm-view-list#readme
- Issues: https://github.com/td231565/npm-view-list/issues
- npm.io page: https://npm.io/package/mv-list

## Dependencies (6)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [@fortawesome/vue-fontawesome](https://npm.io/package/@fortawesome/vue-fontawesome.md) ^2.0.0
- [@fortawesome/fontawesome-svg-core](https://npm.io/package/@fortawesome/fontawesome-svg-core.md) ^1.2.30
- [@fortawesome/free-solid-svg-icons](https://npm.io/package/@fortawesome/free-solid-svg-icons.md) ^5.14.0
- [@fortawesome/free-brands-svg-icons](https://npm.io/package/@fortawesome/free-brands-svg-icons.md) ^5.14.0

## Recent versions

- 1.2.1 (latest) — 2020-10-06
- 1.2.0 — 2020-09-27
- 1.1.9 — 2020-09-27
- 1.1.8 — 2020-09-27
- 1.1.7 — 2020-09-27
- 1.1.6 — 2020-09-27
- 1.1.5 — 2020-09-27
- 1.1.4 — 2020-09-27
- 1.1.3 — 2020-09-27
- 1.1.2 — 2020-09-27
- 1.1.1 — 2020-09-27

## README

# @Multi-view-list/vue
[Demo Page](https://td231565.github.io/npm-view-list/)

## Dependency
* Font-Awesome 5

## UI
There are 2 view mode: row, card.

## Install
```
npm install mv-list
```

## Usage
``` javascript
// main.js

import 'mv-list/dist/multi-view-list.css'
import mvlist from 'mv-list'

Vue.use(mvlist)
```
``` javascript
// your-page.vue

<template>
  <mvList
    :config="listConfig"
    :data="listData"
    default-view="card"
    switch-view="true"
    @on-click="handleClick"
    @on-edit="handleEdit"
    @on-delete="handleDelete" />
</template>

<script>
export default {
  data () {
    return {
      listConfig: {
        // config
      },
      listData: [
        // source
      ]
    }
  }
}
</script>
```

#### List Props

Property        | Type    | Description              | Default | R/O  
--------------- | ------- | ------------------------ | ------- | --------  
config          | Object  |       User custom config |         | Required  
data            | Array   |              source data |         | Required  
editable        | Boolean |           show edit icon |  true   |  
deletable       | Boolean |         show delete icon |  true   |  
switch-view     | Boolean |       show view switcher |  true   |  
default-view    | String  | define initial view mode |  'list' |  

#### List Item Events
Event will return item's source data and it's index from source data array.

Event Name      | Description              | Return Value  
--------------- | ------------------------ | -------------  
on-click        |          click list item | Object, Number   
on-edit         |          click edit icon | Object, Number   
on-delete       |        click delete icon | Object, Number   

## Config
``` javascript
config: {  
    title: {  
        key: 'keyname', // refer to item data's key  
        align: 'left' // text-align: `left`, `center`,  `right`. default: left  
    },   
    image: 'keyname', // refer to item data's key  
    content: {  
        // if you set render function, ignore other attribute.  
        render: (params) => { // `params` is item data
          // do something   
          return `your result ${params.custom.attribute}` // need to be string or es6 template string   
        }  
    },  
    footer: [ // only footer use array. Name is the title for each value.   
        { name: 'Area', key: 'area' },  
        { name: 'Category',  
          render: (params) => params.category.join(', ')  
        }  
    ]  
}  
```

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