vue2-emoji-editor

0.1.14 • Public • Published

vue-emoji-editor

Image text

说明 Introduction

本输入组件是基于HTML5的contenteditable和vue实现,可插入emoji、图片等
emoji列表和图片上传逻辑请自行实现,本组件只处理传进来的文字图片显示
添加emoji或上传后执行this.$refs.emoji.addEmoji(src) 即可在组件内显示
This component is based on HTML5 contenteditable and vue, 
which can insert emoji, pictures, etc
Please implement the emoji list and picture upload logic by yourself
Use this.$refs.emoji.addEmoji(src) to display in the component 
after adding emoji or uploading

安装 Install

npm i vue2-emoji-editor

使用 Quickstart

import EmojiComponent from 'vue2-emoji-editor'

<emoji-component
  ref="emoji"
  @change="change"
/>

属性 Attributes

参数说明类型默认值
v-model / value绑定值string-
disabled是否禁用booleanfalse
max可输入的最大长度 0则不限制number0
clearable是否可清空booleantrue
placeholder占位提示文字string请输入...
autofocus是否自动聚焦booleanfalse
border默认边框string1px solid #ddd
borderActive激活时边框string1px solid #409eff
editorStyle输入框样式,如height: 90pxstring-
imgStyle输入框内图片样式,如width: 52pxstring-
name原生属性string-

事件 Events

事件名称说明回调参数
change绑定值被改变时触发(value, length)
focus输入框获得焦点时触发(event: Event)
blur输入框失去焦点时触发(event: Event)
clear点击清除按钮时触发-

方法 Methods

方法名说明回调参数
addEmoji添加表情或图片(value, length)
getContent获取内容-
focus使输入框获取焦点-
blur使输入框失去焦点-
clear清除内容-

License

MIT Copyright (c) 2020-present, thegithubs

Readme

Keywords

Package Sidebar

Install

npm i vue2-emoji-editor

Weekly Downloads

15

Version

0.1.14

License

ISC

Unpacked Size

48.3 kB

Total Files

14

Last publish

Collaborators

  • thenpmjs