hardlounge/client/components/LinkPreviewToggle.vue

23 lines
407 B
Vue
Raw Normal View History

2018-07-11 18:00:12 +00:00
<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);
2018-07-11 18:00:12 +00:00
}
}
};
</script>