Displaying text with v-text and v-html
HTML is a very powerful tool, but it does have its limitations that forces us to have very verbose and hard-to-maintain code. If you have ever worked on a fully static site without a framework, you may have encountered long HTML pages with many duplicated code blocks. This is where Vue directives come in handy.
Vue’s directives are described on Vue School website as “special HTML attributes that allow us to manipulate the Document Object Model (DOM).”
In previous chapters, we have seen how Vue uses existing attribute syntax to add functionality such as component properties. Vue directives follow a similar approach that creates new functionality by using syntax that resembles existing HTML.
The preceding description says that Vue.js directives allow us to manipulate the DOM, but are there any native HTML attributes that do something similar? The answer is yes.
HTML provides us with attributes such as “value...