1
Next, I’m making a Filter to search some words passed by parameters and check if it exists in the text. The words that are equal I will have to highlight them with a bold and a background. Only, when I tag Strong, vuejs does not render properly.
I have something similar to that:
<p>{{texto|detarcarPalavra("palavra")}}<p>
in the output I wanted, if the word is found, to highlight only this word.
I think in this case it might be better to use the
v-html
. You can show an example of text and how you want HTML to look?– Sergio
The code looks like this: Foundation <Strong>ELE</Strong> of Social Security
– Josivan Sousa
But it should stay like this: Foundation HIM welfare
– Josivan Sousa
Yes, I know. HTML is not treated as HTML. You should use
<p v-html="detarcarPalavra(texto, "palavra")"><p>
– Sergio
Vlw! It worked. Stupid question, but I had become bewildered.
– Josivan Sousa