Files
NSG_PORTAL_V2/components/dynamic-page/page-component/templates/other/copyLinks/ArticleButton.vue
T

43 lines
1.4 KiB
Vue
Raw Normal View History

2024-06-03 12:27:58 +07:00
<script setup lang="ts">
const isBookmark = ref(false)
const onClickBookmark = () => {
isBookmark.value = !isBookmark.value
}
2024-06-03 21:53:23 +07:00
async function copyLink() {
try {
const url = window.location.href
await navigator.clipboard.writeText(url)
alert('copy link thành công')
} catch (error) {
alert(error)
}
}
2024-06-03 12:27:58 +07:00
</script>
2024-05-31 12:39:53 +07:00
<template>
2024-06-03 12:27:58 +07:00
<div class="py-5 flex flex-wrap justify-between items-center">
<div class="flex gap-4 items-center">
<button title="Quay trở lại" class="w-12 h-3rem rounded-full flex items-center justify-center bg-white border-1px shadow hover:bg-primary-100 hover:text-primary-600 cursor-pointer">
2024-05-31 12:39:53 +07:00
<Icon name="fa6-solid:arrow-left" />
2024-06-03 12:27:58 +07:00
</button>
<button @click="onClickBookmark()" class="w-8 h-8 rounded-full bg-white hover:bg-primary-100 hover:text-primary-600">
<Icon v-if="isBookmark === false" name="fa6-regular:bookmark" />
<Icon v-if="isBookmark === true" name="fa6-solid:bookmark" class="text-primary-600" />
2024-05-31 12:39:53 +07:00
</button>
</div>
2024-06-03 12:27:58 +07:00
<div class="flex gap-4 items-center">
2024-06-03 21:53:23 +07:00
<button @click="copyLink()" title="Copy link" class="w-12 h-3rem rounded-full flex items-center justify-center bg-white border-1px shadow hover:bg-primary-100 hover:text-primary-600 cursor-pointer text-2xl">
2024-05-31 12:39:53 +07:00
<Icon name="bi:link-45deg" />
</button>
</div>
</div>
</template>
<style scoped lang="scss">
.center-y {
display: flex;
}
</style>