Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

mixin.js 443B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-05-09 23:00:54
  4. */
  5. const ignores = [
  6. 'version',
  7. 'author',
  8. 'home_page',
  9. 'init',
  10. 'ready',
  11. 'use',
  12. 'mixin',
  13. 'Namespace',
  14. 'Initialized'
  15. ]
  16. /**
  17. * Mix other plug-in attributes to DC
  18. * @param DC
  19. * @returns this
  20. */
  21. export function initMixin(DC) {
  22. DC.mixin = function(mixin) {
  23. for (let key in mixin) {
  24. ignores.indexOf(key) < 0 && (DC[key] = mixin[key])
  25. }
  26. return this
  27. }
  28. }