main.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import App from './App'
  5. import router from './router'
  6. import MintUI from 'mint-ui'
  7. import MuseUI from 'muse-ui'
  8. import store from './store'
  9. import 'mint-ui/lib/style.css'
  10. import './assets/styles/iconfont.css'
  11. import './permission'
  12. // import "lib-flexible";
  13. import '@/styles/reset.scss'
  14. import '@/styles/variables.scss'
  15. // import "@/styles/style.scss";
  16. // eslint-disable-next-line import/no-duplicates
  17. // import Vant from "vant";
  18. // import "vant/lib/index.css";
  19. // import "vant/lib/icon/local.css";
  20. // import '@/styles/vant-css/index.css'
  21. // import "@/styles/media.scss";
  22. import ElementUI from 'element-ui'
  23. import 'element-ui/lib/theme-chalk/index.css'
  24. import pinyin from 'js-pinyin'
  25. // import "./libs/rem.js";
  26. // import "./libs/dpr.js";
  27. import {
  28. DropdownMenu,
  29. DropdownItem,
  30. Tab,
  31. Tabs,
  32. Tag,
  33. TreeSelect,
  34. Area,
  35. Dialog,
  36. Popup,
  37. Cell,
  38. CellGroup,
  39. Picker,
  40. DatetimePicker,
  41. Icon,
  42. SwipeCell,
  43. Button,
  44. ActionSheet,
  45. List,
  46. Field,
  47. Tabbar,
  48. TabbarItem,
  49. Sticky,
  50. Checkbox,
  51. CheckboxGroup,
  52. Toast,
  53. Search,
  54. IndexBar,
  55. IndexAnchor,
  56. Swipe,
  57. SwipeItem,
  58. Col,
  59. Row,
  60. Switch,
  61. Uploader,
  62. Radio,
  63. RadioGroup,
  64. Overlay,
  65. Loading,
  66. Progress,
  67. Sidebar,
  68. SidebarItem,
  69. Stepper,
  70. Collapse,
  71. CollapseItem,
  72. Calendar,
  73. NoticeBar,
  74. NavBar
  75. // eslint-disable-next-line no-irregular-whitespace,import/no-duplicates
  76. } from 'vant'
  77. Vue.use(DropdownMenu)
  78. .use(DropdownItem)
  79. .use(Tab)
  80. .use(Tabs)
  81. .use(Dialog)
  82. .use(Tag)
  83. .use(TreeSelect)
  84. .use(Area)
  85. .use(Popup)
  86. .use(Cell)
  87. .use(CellGroup)
  88. .use(Picker)
  89. .use(DatetimePicker)
  90. .use(Icon)
  91. .use(SwipeCell)
  92. .use(Button)
  93. .use(ActionSheet)
  94. .use(List)
  95. .use(Field)
  96. .use(Tabbar)
  97. .use(TabbarItem)
  98. .use(Sticky)
  99. .use(Checkbox)
  100. .use(CheckboxGroup)
  101. .use(Toast)
  102. .use(Search)
  103. .use(IndexBar)
  104. .use(IndexAnchor)
  105. .use(Swipe)
  106. .use(SwipeItem)
  107. .use(Col)
  108. .use(Row)
  109. .use(Switch)
  110. .use(Uploader)
  111. .use(RadioGroup)
  112. .use(Radio)
  113. .use(Overlay)
  114. .use(Loading)
  115. .use(Progress)
  116. .use(Sidebar)
  117. .use(SidebarItem)
  118. .use(Stepper)
  119. .use(Collapse)
  120. .use(CollapseItem)
  121. .use(Calendar)
  122. .use(NoticeBar)
  123. .use(NavBar)
  124. // import "@/lib/flexible.js";
  125. // main.js
  126. // import 'lib-flexible'
  127. // import { AlertPlugin, ToastPlugin } from 'vux'
  128. // Vue.use(AlertPlugin)
  129. // Vue.use(ToastPlugin)
  130. Vue.use(MintUI)
  131. Vue.use(MuseUI)
  132. // Vue.use(Vant)
  133. Vue.use(ElementUI)
  134. Vue.config.productionTip = false
  135. /* eslint-disable no-new */
  136. var vue = new Vue({
  137. el: '#app',
  138. router,
  139. store,
  140. components: {
  141. App
  142. },
  143. template: '<App/>'
  144. })
  145. Vue.directive('loadmore', {
  146. bind (el, binding) {
  147. const selectWrap = el.querySelector('.el-table__body-wrapper')
  148. selectWrap.addEventListener('scroll', function () {
  149. let sign = 100
  150. const scrollDistance =
  151. this.scrollHeight - this.scrollTop - this.clientHeight
  152. if (scrollDistance <= sign) {
  153. binding.value()
  154. }
  155. })
  156. }
  157. })
  158. export default vue
  159. // eslint-disable-next-line no-undef