2024-04-16 19:33:36 +08:00
|
|
|
<template>
|
2024-05-08 17:52:01 +08:00
|
|
|
<a target="_blank" :href="url"
|
|
|
|
class="h-full py-2 px-4 flex gap-1 items-center font-bold overflow-hidden group-hover:bg-sn-super-light-grey hover:no-underline"
|
|
|
|
>
|
2024-04-16 19:33:36 +08:00
|
|
|
<span v-if="icon" :class="icon" class="sn-icon shrink-0"></span>
|
2024-05-08 17:52:01 +08:00
|
|
|
<StringWithEllipsis
|
|
|
|
:class="{
|
|
|
|
'w-full': !icon,
|
|
|
|
'w-[calc(100%-2rem)]': icon
|
|
|
|
}"
|
2024-04-16 19:33:36 +08:00
|
|
|
:text="value">
|
|
|
|
</StringWithEllipsis>
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import StringWithEllipsis from '../../../shared/string_with_ellipsis.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'LinkTemplate',
|
|
|
|
props: {
|
|
|
|
value: { type: String, default: '' },
|
|
|
|
url: { type: String, default: '' },
|
|
|
|
icon: { type: String, default: '' }
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
StringWithEllipsis
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|