2020-10-16 11:17:50 -07:00
|
|
|
<template>
|
|
|
|
<span>
|
2021-06-27 03:16:14 -07:00
|
|
|
<Icon :v="niceLink.icon" :set="niceLink.iconSet || 'l'"/>
|
2021-12-14 06:15:27 -08:00
|
|
|
<a :href="linkTrimmed" target="_blank" :rel="verifiedBy ? 'me' : 'noopener'">
|
2021-06-27 03:16:14 -07:00
|
|
|
{{niceLink.text}}
|
2020-10-16 11:17:50 -07:00
|
|
|
</a>
|
2021-12-14 06:15:27 -08:00
|
|
|
<small v-if="verifiedBy">
|
|
|
|
<Icon v="shield-check"/>
|
|
|
|
</small>
|
2020-10-16 11:17:50 -07:00
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-06-27 03:16:14 -07:00
|
|
|
import link from '../plugins/link';
|
2020-10-16 11:17:50 -07:00
|
|
|
|
|
|
|
export default {
|
2021-06-27 03:16:14 -07:00
|
|
|
mixins: [link],
|
2020-10-16 11:17:50 -07:00
|
|
|
props: {
|
|
|
|
link: { required: true },
|
2021-09-07 08:37:24 -07:00
|
|
|
expand: { type: Boolean },
|
2021-12-14 06:15:27 -08:00
|
|
|
verifiedLinks: { 'default': () => {return {}} },
|
2020-10-16 11:17:50 -07:00
|
|
|
},
|
|
|
|
computed: {
|
2021-01-21 12:04:56 -08:00
|
|
|
linkTrimmed() {
|
|
|
|
return this.link.trim();
|
|
|
|
},
|
2021-06-27 03:16:14 -07:00
|
|
|
niceLink() {
|
2021-12-14 06:15:27 -08:00
|
|
|
return this.beautifyLink(this.linkTrimmed, this.expand, this.verifiedBy);
|
2020-10-16 11:17:50 -07:00
|
|
|
},
|
2021-12-14 06:15:27 -08:00
|
|
|
verifiedBy() {
|
|
|
|
return this.verifiedLinks[this.link];
|
|
|
|
}
|
2020-10-16 11:17:50 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
2020-10-18 02:43:56 -07:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.icon {
|
|
|
|
height: 1em;
|
|
|
|
}
|
|
|
|
</style>
|