# neumedia-site-configuration

> 管理平台站点配置列表：表格，可编辑。

Latest version **1.0.1** (published 2021-04-13) · 0 weekly downloads

## Install

```sh
npm install neumedia-site-configuration
pnpm add neumedia-site-configuration
yarn add neumedia-site-configuration
bun add neumedia-site-configuration
```

## 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.0.1 |
| Published | 2021-04-13 |
| First published | 2021-04-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | shenli_li |

## Links

- npm: https://www.npmjs.com/package/neumedia-site-configuration
- npm.io page: https://npm.io/package/neumedia-site-configuration

## Dependencies (3)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [ant-design-vue](https://npm.io/package/ant-design-vue.md) ^1.7.4

## Recent versions

- 1.0.1 (latest) — 2021-04-13
- 1.0.0 — 2021-04-13
- 0.1.0 — 2021-04-13

## README

# 管理平台站点配置列表

管理平台站点配置列表：表格，可编辑。

## 更新历史

| 版本号 | 作者                    | 更新记录 | 更新时间   |
| ------ | ----------------------- | -------- | ---------- |
| 1.0.0  | sl | 初始版本 | 2021.04.13 |
|        |                         |          |            |

### 安装
```
yarn add neumedia-site-configuration
```

## 导入

```javascript
import NeumediaSiteConfiguration from 'neumedia-site-configuration'

export default {
    components: {
        NeumediaSiteConfiguration
    }
}
```

## 使用

```html
<neumedia-site-configuration
    ref="siteConfig" 
    :columns="[{title: '配置项', key: 'configuration', dataIndex: 'configuration',  align: 'center'}]" 
    :tableData="[ { key: '1', configuration: '配置项'}]" 
    :actions="[{ name: '编辑', options: [ { title: '配置项', value: 'configuration' } ],  handle: 'editItem' }]" 
    @editItem="editItem"
></neumedia-site-configuration>
```

## API

### Props

| 说明           | 说明                 | 类型    | 默认值      |
| -------------- | -------------------- | ------ | ----------- |
| columns        | 表格列配置            | Array  | []          |
| tableData      | 表格数据              | Array  | []          |
| actions        | 表格操作列配置         | Array |  []          |
| pagination     | 表格分页               | Boolean Object | false   |
| Function(newVal, oldVal)   |  表格操作处理  | 


`columns`展示
[
    {
        title: '配置项',
        key: 'configuration',
        dataIndex: 'configuration',
        align: 'center'
    },
    {
        title: '值',
        dataIndex: 'value',
        key: 'value',
        align: 'center'
    },
    {
        title: '操作',
        key: 'action',
        scopedSlots: { customRender: 'action' },
        align: 'center'
    }
]

`tableData`展示
[
    {
        key: '1',
        configuration: '配置项1',
        value: '配置项1值'
    },
    {
        key: '2',
        configuration: '配置项2',
        value: '配置项2值'
    },
    {
        key: '3',
        configuration: '配置项3',
        value: '配置项3值'
    }
]

`actions`展示
[
    {
        name: '编辑',                       (modal-title显示)
        options: [                          (编辑操作配置)
            {
                title: '配置项',                (编辑：input-label)
                value: 'configuration',         (编辑：input-value)
                disabled: true,                 (编辑：input-disabled 该项是否可编辑     true-不可编辑)
                hidden: true                    (编辑：input是否隐藏   true-隐藏)
                rules: [                        (编辑：input验证规则)
                    { required: true, message: '不能为空' }
                ]
            }
        ],
        handle: 'editItem'                  (编辑后执行操作，emit调用父组件方法，参数newVal - 编辑后的值， oldVal - 旧值)
    },
]

###  组件内部方法

`resetBtnsStatus`   取消编辑操作确定按钮加载中状态

`handleClose`       关闭编辑modal

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