thelounge/client/components/LinkPreviewToggle.vue
2019-02-12 12:48:43 +02:00

22 lines
399 B
Vue

<template>
<button
v-if="link.canDisplay"
:class="['toggle-button', 'toggle-preview', { opened: link.shown }]"
@click="onClick"/>
</template>
<script>
export default {
name: "LinkPreviewToggle",
props: {
link: Object,
},
methods: {
onClick() {
this.link.shown = !this.link.shown;
this.$parent.$emit("linkPreviewToggle", this.link, this.$parent.message);
},
},
};
</script>