create-basic.js 363 B

12345678910111213141516
  1. /**
  2. * Create a basic component with common options
  3. */
  4. import bem from '../mixins/bem';
  5. const install = function(Vue) {
  6. Vue.component(this.name, this);
  7. };
  8. export default function(sfc) {
  9. sfc.name = 'avue-' + sfc.name;
  10. sfc.install = sfc.install || install;
  11. sfc.mixins = sfc.mixins || [];
  12. sfc.mixins.push(bem);
  13. return sfc;
  14. }