vue-wechat-comment
v1.0.0
Published
The cover wechat comment for vue3
Readme
The cover wechat comment for vue3
Support emoji and extend emoji Support text Support voice record
Keydown enter or click send button to send text message.
Quick start
npm i vue-wechat-commentHow to import
import WechatComment from 'vue-wechat-comment'
import 'vue-wechat-comment/dist/vue-wechat-comment.css'How to use
//Extend more emoji.
const extEmoji = {
mmz: [{
name: "mmz_00",
ext: "gif",
path: "/emoji/mmz/mmz_00.gif" //local path or remote url
},
{
name: "mmz_01",
ext: "gif",
path: "/emoji/mmz/mmz_01.gif"
},
{
name: "mmz_02",
ext: "gif",
path: "/emoji/mmz/mmz_02.gif"
},
{
name: "mmz_03",
ext: "gif",
path: "/emoji/mmz/mmz_03.gif"
}]
};<wechat-comment @sendCb="(msg) => { console.log(msg) }" :emoji="extEmoji"></wechat-comment>API reference
Initialisation
| Props | Description | Default |
|---------------------------------------------|----------------------------------------------------------------------|:------------------:|
| show: Boolean | Show the wechat-comment component. | true |
| modules: String | Support voice(voice record) emoji send(send btn). | voice,emoji,send |
| position: String | Set the position of the component.Support bottom top relative. | bottom |
| emoji: Object | Extend more emoji. | {} |
| activeDefaultEmoji: String | Active the default emoji tab when you expand the emoji first time. | first |
| disabledDefaultEmoji: Boolean | Disabled the default emoji. | false |
| Events | Description | Callback params |
|-------------------|--------------------------------------------|:------------------------------------------------------------------------------------:|
| sendCb | Callback when you send message. | { type: "emoji", content: {name:"mmz_00",ext:"gif",path:"/emoji/mmz/mmz_00.gif"} } |
| focus | Callback when you focus the input element. | INPUT HTML ELEMENT |
| input | Callback when you focus the input element. | INPUT HTML ELEMENT |
| startVoice | Callback when you start voice record. | |
| stopVoice | Callback when you stop voice record. | cancel or send |
