Use rel=“noopener” on non-relative links

This commit is contained in:
Sam Carlton 2020-09-21 18:56:10 -05:00
parent 7c6bdef5f4
commit 4ce21fa890

View file

@ -3,6 +3,7 @@
<a
:href="href"
:target="target"
:rel="rel"
role="button"
class="relative inline-flex items-center px-4 py-2 border border-transparent leading-5 font-medium rounded-md text-white bg-darker neumorphic-shadow hover:bg-indigo-400 focus:outline-none focus:shadow-outline-indigo focus:border-indigo-600 active:bg-indigo-600 transition duration-150 ease-in-out"
>
@ -23,6 +24,13 @@ export default {
type: String,
default: null
}
},
computed: {
rel () {
if (this.href.charAt(0) === '/') return null
return 'noopener'
}
}
}