Image for post
Image for post

Hi guys!

In this article, in a special way, I will talk about a feature that in my opinion is little used (or commented on) within the Vue.js community, which are Filters. Like Plugins, Custom Directives and Mixins, filters are part of the reusable features within Vue, helping in the process of creating components.

In Vue components, filters are functionalities that allow us to obtain different formats in the output of the dynamic data of its state. That is, they do not change the data of a component, they can only format their data in rendering.

Local filters

According to the official documentation, the use of filters occurs within mustache interpolations and v-bind expressions. See an example of the formatting of the filter in the…


Image for post
Image for post

Olá pessoal!

Nesse artigo, de forma especial, irei falar sobre uma funcionalidade que na minha opinião é pouco utilizada (ou comentada) dentro da comunidade Vue.js, que são os Filtros. Assim como os Plugins, Diretivas Personalizadas e os Mixins, os filtros fazem parte das funcionalidades reutilizáveis dentro do Vue, auxiliando no processo de criação de componentes.

Nos componentes do Vue, os filtros são funcionalidades que nos permitem obter diversas formatações na saída dos dados dinâmicos do seu estado. Ou seja, eles não alteram os dados de um componente, apenas podem formatar seus dados na renderização.

Filtros locais

Conforme a documentação oficial, a utilização dos filtros ocorrem dentro de interpolações mustache e expressões v-bind. Veja um exemplo da formatação do filtro no…


Image for post
Image for post

Through my work with Vue, I have gained experience in developing components and reusing them in applications, thus gaining agility, time, resources, among others. And in recent projects I had come to realize that some of my components had very similar code, including some methods, computed properties.

It was a lot of code that I practically copied and pasted from one component to another, changing small details and that caught my attention, so I went to get more information on the internet, mainly in the documentation of Vue.js …

About

Matheus Ricelly

PHP Web Developer and front-end enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store