Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 16, 2019 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/dc4bfa96b6108bd3b89dd6697c054bb1 to your computer and use it in GitHub Desktop.
Save parzibyte/dc4bfa96b6108bd3b89dd6697c054bb1 to your computer and use it in GitHub Desktop.
// Registrar el filtro
Vue.filter("mayusculas", v => (v || "").toString().toUpperCase());
// El otro filtro
Vue.filter("cortar", v => (v || "").substr(0, 10) + "...");
// Dentro de la instancia no es necesario declararlo
// pues ya está registrado globalmente
new Vue({
el: "#app",
data: () => ({
nombre: "Luis Cabrera Benito"
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment