Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created June 6, 2018 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/2654e43cee149f9f2708962e057b2276 to your computer and use it in GitHub Desktop.
Save nathanpeck/2654e43cee149f9f2708962e057b2276 to your computer and use it in GitHub Desktop.
var store = {
data: {
typing: []
},
addTyper: function(typer) {
this.data.typing.push(typer);
}
};
Vue.component('typing', {
template: `
<div v-if="typing.length > 0" class='message replies'>
<img v-for='typer in typing' :src="typer.avatar" />
<div class="typing-indicator">
<span></span><span></span><span></span>
</div>
</div>
`,
data: {
typing: store.data.typing
}
});
store.addTyper({
avatar: 'https://pbs.twimg.com/profile_images/899693023969333254/d-_mIPm8_400x400.jpg'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment