There is a problem using the template string character of es6 in angular

No problem in this way

showDelText: ` ${delText} `

: 1 

but if I add the html tag, it will display along with the html tag

showDelText: `
        
        <div> ${delText} </div>
        
        `,
        
        : <div> 1 </div> 

the html tag should not be displayed, should it? What went wrong?

Dec.09,2021

the key is how you use the showDelText. In the end, it generates a string. If you want it to parse the div tag, you need to insert it as a dom node in the same place.
Native: innerHtml
jQuery: html ()
vue: v-html learn about

Menu