hardlounge/client/components/LinkPreviewToggle.vue

24 lines
409 B
Vue
Raw Normal View History

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