cngu / vue-typer

Vue component that simulates a user typing, selecting, and erasing text.
https://cngu.github.io/vue-typer
MIT License
792 stars 51 forks source link

Added possibility to fire Events for each char which gets typed #20

Closed Gr33nbl00d closed 6 years ago

Gr33nbl00d commented 6 years ago

An event is now emitted after each single char which was typed.

<vue-typer @typed-char="onCharTyped" text='hello'/>

function onCharTyped(lastCharTyped){}

The function used for listening gets called with one parameter which is the last char which was rendered.

This can be handy if special effects should be executed after a char was rendered. I used this to create a typing sound effect and used for each character a different typing sound :)

Gr33nbl00d commented 6 years ago

Second approach i finally found some time for it ;)