Understanding filters
Another important feature of Vue is filters. Filters are functions that will transform Vue data for use in the DOM.
For that reason, they're usually used in interpolations or in v-bind
expressions.
Let's have an example.
Imagine we have a data property called message
which is a string.
We want to transform that string by capitalizing the first letter. So we create a filter called capitalize
.
Click to load comments...