thelounge/client/components/LinkPreviewToggle.vue

23 lines
400 B
Vue
Raw Normal View History

2018-07-11 18:00:12 +00:00
<template>
<button
v-if="link.canDisplay"
2018-07-12 08:26:12 +00:00
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
2018-07-29 17:57:14 +00:00
@click="onClick" />
2018-07-11 18:00:12 +00:00
</template>
<script>
export default {
name: "LinkPreviewToggle",
props: {
link: Object,
},
methods: {
2018-07-12 08:26:12 +00:00
onClick() {
2018-07-11 18:00:12 +00:00
this.link.shown = !this.link.shown;
this.$parent.$emit("linkPreviewToggle", this.link, this.$parent.message);
2018-07-12 08:26:12 +00:00
},
},
2018-07-11 18:00:12 +00:00
};
</script>