Skip to content

Instantly share code, notes, and snippets.

@asvae
Created January 14, 2016 14:18
Show Gist options
  • Save asvae/69ed015e77bd2ed17853 to your computer and use it in GitHub Desktop.
Save asvae/69ed015e77bd2ed17853 to your computer and use it in GitHub Desktop.
import _ from 'lodash'
module.exports = function (Vue){
// Глобальные миксины.
Vue.mixin({
props: {
id: {
default: function (){
var component_name = _.kebabCase(this.constructor.name);
if (component_name.substring(0,3) === 'vm-')
component_name = component_name.substring(3)
return component_name + '-' + this._uid
},
},
class: {
default: '',
type: String,
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment