# 4icloud-listform

> > 可插入自定义标签的 textarea

Latest version **1.0.12** (published 2020-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install 4icloud-listform
pnpm add 4icloud-listform
yarn add 4icloud-listform
bun add 4icloud-listform
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2020-07-22 |
| First published | 2020-07-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 29 |
| Unpacked size | 13.1 MB |
| Known vulnerabilities | 0 (+40 in 9 direct dependencies) |
| Install scripts | no |
| Author | ken xie |
| Maintainers | 4icloud |

## Links

- npm: https://www.npmjs.com/package/4icloud-listform
- npm.io page: https://npm.io/package/4icloud-listform

## Dependencies (29)

- [vue](https://npm.io/package/vue.md) 2.6.10
- [vuex](https://npm.io/package/vuex.md) 3.1.0
- [xlsx](https://npm.io/package/xlsx.md) 0.14.1
- [axios](https://npm.io/package/axios.md) 0.18.1
- [jszip](https://npm.io/package/jszip.md) 3.2.1
- [moment](https://npm.io/package/moment.md) ^2.27.0
- [echarts](https://npm.io/package/echarts.md) 4.2.1
- [fuse.js](https://npm.io/package/fuse.js.md) 3.4.4
- [dropzone](https://npm.io/package/dropzone.md) 5.5.1
- [jsonlint](https://npm.io/package/jsonlint.md) 1.6.3
- [showdown](https://npm.io/package/showdown.md) 1.9.0
- [vue-i18n](https://npm.io/package/vue-i18n.md) 7.3.2
- [clipboard](https://npm.io/package/clipboard.md) 2.0.4
- [driver.js](https://npm.io/package/driver.js.md) 0.9.5
- [js-cookie](https://npm.io/package/js-cookie.md) 2.2.0
- [nprogress](https://npm.io/package/nprogress.md) 0.2.0
- [codemirror](https://npm.io/package/codemirror.md) 5.45.0
- [element-ui](https://npm.io/package/element-ui.md) 2.13.0
- [file-saver](https://npm.io/package/file-saver.md) 2.0.1
- [screenfull](https://npm.io/package/screenfull.md) 4.2.0
- [sortablejs](https://npm.io/package/sortablejs.md) 1.8.4
- [tui-editor](https://npm.io/package/tui-editor.md) 1.3.3
- [vue-router](https://npm.io/package/vue-router.md) 3.0.2
- [vue-count-to](https://npm.io/package/vue-count-to.md) 1.0.13
- [vuedraggable](https://npm.io/package/vuedraggable.md) 2.20.0
- [normalize.css](https://npm.io/package/normalize.css.md) 7.0.0
- [vue-splitpane](https://npm.io/package/vue-splitpane.md) 1.0.4
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) 2.4.0
- [vue-tag-textarea-demo](https://npm.io/package/vue-tag-textarea-demo.md) ^0.1.0

## Recent versions

- 1.0.12 (latest) — 2020-07-22
- 1.0.11 — 2020-07-22
- 1.0.10 — 2020-07-22
- 1.0.9 — 2020-07-22
- 1.0.8 — 2020-07-22
- 1.0.7 — 2020-07-22
- 1.0.6 — 2020-07-22
- 1.0.5 — 2020-07-21
- 1.0.4 — 2020-07-21
- 1.0.3 — 2020-07-21
- 1.0.2 — 2020-07-21
- 1.0.1 — 2020-07-21
- 1.0.0 — 2020-07-21

## README

# VueTagTextarea

> 可插入自定义标签的 textarea

## 安装

``` bash
$ npm install vue-tag-textarea -S
```
## 使用

在 `main.js` 文件中引入插件并注册

``` bash
# main.js
import VueTagTextarea from 'vue-tag-textarea'
import 'vue-tag-textarea/lib/vue-tag-textarea.css'
Vue.use(VueTagTextarea)
```

在项目中用使用 VueTagTextarea


```js
<template>
  <w-textarea v-model="text" />
</template>
<script>
  export default {
    data () {
      return {
        text: 'demo'
      }
    }
  }
</script>
```

注意：标签为 `<w-textarea>`

## 特点
1. 可以插入自定义的标签，默认为 `<wise>`
2. 基于自定义标签，可以满足模版文案的需求

## 参数

| 参数 | 说明 | 类型 | 默认值 |
| ------ | ------ | ------ | ------ |
| tag | 自定义标签名 | String | wise |
| tools | 配置工具栏 | Array | [{ type: 'link', text: '添加超链接' }, { type: 'tag', text: '添加模版标签' }] |
| maxlength | 最大字符长度 | String, Number | - |

> 自定义 tag 的时候，需要添加该标签的样式


## 事件

| 事件名称 | 说明 | 回调参数 |
| ------ | ------ | ------ |
| add | 点击工具栏上的“添加xx”按钮时触发 | type |

## Add 事件详解
工具栏可以通过 tools 参数进行配置，tools 的元素是一个包含 type 和 text 的对象，其中 text 为工具栏按钮的文字。  
当点击工具栏按钮的时候，触发 add 事件，接收一个 type 参数，该参数为 tools 中定义的 type 属性值。  
具体的交互逻辑需要自行开发，最后需要通过 $refs 调用 VueTagTextarea 内部的 addLink() 或者 addTag() 方法，完成添加标签。  
当调用 addTag() 的时候，需要传入一个 text 参数，值为标签的文本内容。  
当调用 addLink() 的时候，需要传入 url 和 text，其中 url 为超链接地址，text 为超链接文本。  
VueTagTextarea 最终返回的值是一个 innerHTML。

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