Created
June 6, 2018 17:15
-
-
Save nathanpeck/2654e43cee149f9f2708962e057b2276 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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