Created
January 14, 2016 14:18
-
-
Save asvae/69ed015e77bd2ed17853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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