Home > database >  Bold word in a text
Bold word in a text

Time:12-03

I would like to put in bold key words found in a paragraph.

Here my code for the moment :

       <div v-for="item in data.description" :key="item">
          {{item}}
       </div>

Item is all the sentences of my description.

On my interface I have for example the following text:

125.475 mhz will not be avbl. pilots requesting flight information During this period may contact london control on the notified h24
Frequencies in the aip page enr 2.1

I would like to put in bold the word "frequencies" just in the sentence where there is this word.

Do you know how to do that ?

Thank you

CodePudding user response:

Replace

{{item}}

with

<span v-html="item.replaceAll('frequencies', '<b>frequencies</b>')"></span>
  • Related