index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. //导入组件
  2. import mButton from "./components/button/index";
  3. import mInput from "./components/input/index";
  4. import mRow from "./components/row/index";
  5. import mCol from "./components/col/index";
  6. import mSpace from "./components/space/index";
  7. import mTextarea from "./components/textarea/index";
  8. import mLink from "./components/link/index";
  9. import mTag from "./components/tag/index";
  10. import mRadio from "./components/radio/index";
  11. import mRadioGroup from "./components/radio-group/index";
  12. import mRadigButton from "./components/radio-button/index";
  13. import mSelect from "./components/select/index";
  14. import mOption from "./components/option/index";
  15. import mSwitch from "./components/switch/index";
  16. import mCheckbox from "./components/checkbox/index";
  17. import mCheckboxGroup from "./components/checkbox-group/index";
  18. import mCheckboxButton from "./components/checkbox-button/index";
  19. import mInputNumber from "./components/input-number/index";
  20. import mTimePicker from "./components/time-picker/index";
  21. import mDatePicker from "./components/date-picker/index";
  22. import mRate from "./components/rate/index";
  23. // Data 数据展示
  24. import mProgress from "./components/progress/index";
  25. import mCard from "./components/card/index";
  26. import mBadge from "./components/badge/index";
  27. import mTable from "./components/table/index";
  28. import mTableColumn from "./components/table-column/index";
  29. import mPagination from "./components/pagination/index";
  30. import mTree from "./components/tree/index";
  31. // Navigation 导航
  32. import mBreadcrumb from "./components/breadcrumb/index";
  33. import mBreadcrumbItem from "./components/breadcrumb-item/index";
  34. import mDropdown from "./components/dropdown/index";
  35. import mDropdownItem from "./components/dropdown-item/index";
  36. import mDropdownMenu from "./components/dropdown-menu/index";
  37. import mTabs from "./components/tabs/index";
  38. import mTabPane from "./components/tab-pane/index";
  39. import mMenu from "./components/menu/index";
  40. import mMenuGroup from "./components/menu-group/index";
  41. import mMenuItem from "./components/menu-item/index";
  42. import mSubmenu from "./components/submenu/index";
  43. //Feedback 反馈组件
  44. import mAlert from "./components/alert/index";
  45. import mDialog from "./components/dialog/index";
  46. import mMessage from "./components/message/index";
  47. import mDrawer from "./components/drawer/index";
  48. import Loading from "./components/loading";
  49. // 组件列表
  50. const components = [
  51. mButton,
  52. mInput,
  53. mRow,
  54. mCol,
  55. mSpace,
  56. mTextarea,
  57. mLink,
  58. mTag,
  59. mRadio,
  60. mRadioGroup,
  61. mRadigButton,
  62. mSelect,
  63. mOption,
  64. mSwitch,
  65. mCheckbox,
  66. mCheckboxGroup,
  67. mCheckboxButton,
  68. mInputNumber,
  69. mTimePicker,
  70. mDatePicker,
  71. mRate,
  72. //Data 数据展示
  73. mProgress,
  74. mCard,
  75. mBadge,
  76. mTable,
  77. mTableColumn,
  78. mPagination,
  79. mTree,
  80. //Navigation 导航
  81. mBreadcrumb,
  82. mBreadcrumbItem,
  83. mDropdown,
  84. mDropdownItem,
  85. mDropdownMenu,
  86. mTabs,
  87. mTabPane,
  88. mMenu,
  89. mMenuGroup,
  90. mMenuItem,
  91. mSubmenu,
  92. //Feedback 反馈组件
  93. mAlert,
  94. mDialog,
  95. mDrawer
  96. ]
  97. // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,那么所有的组件都会被注册
  98. const install = (Vue) => {
  99. // 判断是否安装
  100. if (install.installed) return
  101. // 遍历注册全局组件
  102. components.map(component => Vue.component(component.name, component))
  103. Vue.config.globalProperties.$message = mMessage
  104. Vue.config.globalProperties.$loading = Loading.service
  105. Vue.directive('loading', Loading.directive);
  106. }
  107. if (typeof window !== 'undefined' && window.Vue) {
  108. install(window.Vue);
  109. }
  110. export default {
  111. install,
  112. mButton,
  113. mInput,
  114. mRow,
  115. mCol,
  116. mSpace,
  117. mTextarea,
  118. mLink,
  119. mTag,
  120. mRadio,
  121. mRadioGroup,
  122. mRadigButton,
  123. mSelect,
  124. mOption,
  125. mSwitch,
  126. mCheckbox,
  127. mCheckboxGroup,
  128. mCheckboxButton,
  129. mInputNumber,
  130. mTimePicker,
  131. mDatePicker,
  132. mRate,
  133. //Data 数据展示
  134. mProgress,
  135. mCard,
  136. mBadge,
  137. mTable,
  138. mTableColumn,
  139. mPagination,
  140. mTree,
  141. //Navigation 导航
  142. mBreadcrumb,
  143. mBreadcrumbItem,
  144. mDropdown,
  145. mDropdownItem,
  146. mDropdownMenu,
  147. mTabs,
  148. mTabPane,
  149. mMenu,
  150. mMenuGroup,
  151. mMenuItem,
  152. mSubmenu,
  153. //Feedback 反馈组件
  154. mAlert,
  155. mDialog,
  156. mMessage,
  157. mDrawer
  158. }