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.

index.js 597B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @Author: Caven
  3. * @Date: 2020-02-02 15:55:53
  4. */
  5. const install = function(DC) {
  6. if (!echarts) {
  7. throw new Error('Chart: missing charts lib')
  8. }
  9. if (!DC || !DC.init) {
  10. throw new Error('Chart: Missing DC Base')
  11. }
  12. DC.init(() => {
  13. try {
  14. DC.mixin(require('./src/components.js').default)
  15. } catch (e) {
  16. // eslint-disable-next-line no-console
  17. console.error(e)
  18. }
  19. })
  20. }
  21. /* istanbul ignore if */
  22. if (typeof window !== 'undefined' && window.DC) {
  23. install(window.DC)
  24. }
  25. export default {
  26. version: __VERSION__,
  27. compile_time: __TIME__,
  28. install
  29. }