Skip to content

Instantly share code, notes, and snippets.

@vinicius73
Created November 5, 2015 14:50
Show Gist options
  • Save vinicius73/9383665c77fa425c5163 to your computer and use it in GitHub Desktop.
Save vinicius73/9383665c77fa425c5163 to your computer and use it in GitHub Desktop.
VueJS implode filter
Vue.filter('implode', function (value, piece, key) {
piece = piece ? piece : ', ';
if(_.isUndefined(key)) {
return value.join(piece);
}
return _.pluck(value, key).join(piece);
});
// needs undescorejs // http://underscorejs.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment