1.1.0 • Published 4 years ago

vue-box-input v1.1.0

Weekly downloads
5
License
MIT
Repository
-
Last release
4 years ago

vue-box-input

Version License Downloads

A Vue.js component of chat input box

Features

  • Supports Vue2
  • Press 'shift + enter' to Change line
  • Press 'enter' to send message
  • Support 'paste event', we can get the image file and the text that is pasting in box.
  • Support the cursor positioning when we insert Text or emoji

Installation

NPM

$ npm install vue-box-input --save

Yarn

$ yarn add vue-box-input

Component Attributes:

参数说明类型默认值必写
emoji可插入的表情包(emoji)字符串String-false

Component Methods:

参数说明类型默认值必写
inputinput事件Function(val)-false
image-paste剪贴板图片粘贴事件Function(file)-false
message-send消息发送事件Function(text)-true
clearMessage清空输入框中的信息Function-false

How To Use

Import:
import Vue from 'vue'
import VueBoxInput from 'vue-box-input'
Vue.use(VueBoxInput)

Component Use:
 	<vue-box-input
 		  :emoji="emojiValue"
      ref="chatBox"
	    @input="handleWordsInput"
	    @image-paste="handleImageFileGet"
	    @message-send="handleMessageSend"
	    >

    </vue-box-input>

    this.$refs.chatBox.clearMessage();

Update Log

  • version 1.1.0 => add clearMessage function
  • version 1.0.0 => add basic function of a chat input box

License

MIT