Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Last active June 20, 2019 10:56
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 uno-de-piera/3ca4413f01893a0ffd8dd7439fa97ea2 to your computer and use it in GitHub Desktop.
Save uno-de-piera/3ca4413f01893a0ffd8dd7439fa97ea2 to your computer and use it in GitHub Desktop.
Vue.filter('booleanToString', function (boolean, ifTrue, ifFalse) {
return boolean ? ifTrue : ifFalse;
});
this.$options.filters.booleanToString(user.active, 'Sí', 'No')
{{ user.active | booleanToString('Sí', 'No') }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment