Hello I have this property: text, and it contains a url but as plain text. I want to convert the url so it will be clickable.
<template>
<div>
<button class="fas fa-angle-down jwsingle__player__text__toggle" @click="toggle" :class="{ 'jwsingle__player__text__toggle--active': isOpen }">
</button>
<div v-show="isOpen" class="jwsingle__player__text__description">
{{ text }}
</div>
</div>
</template>
<script>
export default {
name: 'jwplayer-text-toggle',
props: {
text: {
type: String,
},
},
data() {
return {
isOpen: false,
}
},
methods: {
toggle() {
this.isOpen = !this.isOpen;
}
}
}
</script>
<a :src="text">click me</a>tag. You should probably consider renaming "text" to "url" if it's always a URL<a :href="text">:)