You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mixin.js 473B

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