index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import LemonTabs from "./components/tabs";
  2. import LemonPopover from "./components/popover";
  3. import LemonButton from "./components/button";
  4. import LemonBadge from "./components/badge";
  5. import LemonAvatar from "./components/avatar";
  6. import LemonContact from "./components/contact";
  7. import LemonEditor from "./components/editor";
  8. import LemonMessages from "./components/messages";
  9. import LemonMessageBasic from "./components/message/basic";
  10. import LemonMessageText from "./components/message/text";
  11. import lemonMessageImage from "./components/message/image";
  12. import lemonMessageFile from "./components/message/file";
  13. import lemonMessageEvent from "./components/message/event";
  14. import LemonIMUI from "./components/index";
  15. import "./styles/common/index.styl";
  16. const version = "0.1";
  17. const components = [
  18. LemonIMUI,
  19. LemonContact,
  20. LemonMessages,
  21. LemonEditor,
  22. LemonAvatar,
  23. LemonBadge,
  24. LemonButton,
  25. LemonPopover,
  26. LemonTabs,
  27. LemonMessageBasic,
  28. LemonMessageText,
  29. lemonMessageImage,
  30. lemonMessageFile,
  31. lemonMessageEvent
  32. ];
  33. const install = (Vue, opts = {}) => {
  34. components.forEach(component => {
  35. Vue.component(component.name, component);
  36. });
  37. };
  38. if (typeof window !== "undefined" && window.Vue) {
  39. install(window.Vue);
  40. }
  41. export default {
  42. version,
  43. install
  44. };