diff options
Diffstat (limited to 'demo/components/chat.js')
-rw-r--r-- | demo/components/chat.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/demo/components/chat.js b/demo/components/chat.js index 86d8fe7..08b478b 100644 --- a/demo/components/chat.js +++ b/demo/components/chat.js @@ -1,13 +1,13 @@ import { Name } from './name.js' +import LikeButton from './like-button.js' export default { - components: { Name }, - - props: ['tags'], + components: { Name, LikeButton }, data: ()=> ({ - message: '' + message: '', + channel: 'demo' }), methods: { @@ -25,20 +25,23 @@ export default { this.$graffitiUpdate({ message: this.message, timestamp: Date.now(), - _tags: this.tags + _tags: [this.channel] }) this.message = '' } }, template: ` - <graffiti-objects :tags="tags" v-slot="{objects}"> + Chat Channel: <input v-model="channel"/> + + <graffiti-objects :tags="[channel]" v-slot="{objects}"> <ul v-for="object in messageObjects(objects)"> <li> <em><Name :of="object._by"/></em>: - {{ object.message }} + <LikeButton :messageID="object._id" /> + <template v-if="object._by==$graffitiMyID"> <button @click="object.message+='!!';object._update()"> ‼️ |