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

23 lines
407 B
Vue

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