2π
β
Any value given to input tag (also textarea) will be treated as a string
.
To show channel name in the textarea
tag, you can do this
computed: {
channel: {
get() {
const selectedChannel = this.$store.getters.selectedChannel;
// using regex to match the text between "b" tag
const channelName = selectedChannel.match("<b\b[^>]*>(.*?)<\/b>")[1];
return selectedChannel ? `<textarea>${channelName}</textarea>` : '';
}
In template:
<div class="channels" v-html="channel">
</div>
π€Srinivas Damam
0π
You need to use the v-html directive:
<div class="channels" v-html="channel">
</div>
Sample fiddle here
π€Gus
Source:stackexchange.com