shershen08 / emoji-vue

Add emoji keyboard to your vuejs project
MIT License
141 stars 24 forks source link

Reset text input? #9

Closed sheriffmarley closed 5 years ago

sheriffmarley commented 5 years ago

How can I reset the text in the plugin?

<VueEmoji @input="onInput" :value="myText" width="500" height="25"/>
...

onInput(event){
                this.messageText = event.data;
            },

I tried

reset(){
  this.myText = "";
  this.messageText = "";
}

but it still shows the content.

shershen08 commented 5 years ago

Indeed that was missing, I've added it in coming version - https://github.com/shershen08/emoji-vue/pull/8/commits/5e361eaecb064d06621941d760243acdf1869d74

so it could be executed as follows:

clearTextarea(){
      this.$refs.emojiTextarea.clear()
    },  
shershen08 commented 5 years ago

Add this in 0.2.4 and now in readme code sample - https://github.com/shershen08/emoji-vue#use-