line / promgen

Promgen is a configuration file generator for Prometheus
https://line.github.io/promgen/
MIT License
1.04k stars 150 forks source link

Convert Vue filters into methods #441

Closed vincent-olivert-riera closed 8 months ago

vincent-olivert-riera commented 8 months ago

In Vue 3, filters are removed and no longer supported. Instead, they recommend replacing them with method calls or computed properties.

https://v3-migration.vuejs.org/breaking-changes/filters.html

Since those methods can be reused in multiple components we store them as mixins instead of defining them in specific components. Mixins work in both Vue 2 and Vue 3.

The recommendation for migrating global filters in Vue 3 is to store them as global properties [1], however that is not supported in Vue 2.

1: https://vuejs.org/api/application.html#app-config-globalproperties


This PR will make the future PR for migrating to Vue 3 much shorter.

vincent-olivert-riera commented 8 months ago

I fixed the year in the copyright of the mixins.vue.js file.