skhj-variant 2.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (346) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/package.iml +12 -0
  4. package/README.md +180 -0
  5. package/babel.config.js +5 -0
  6. package/dist/build/css/app.9b74af27.css +1 -0
  7. package/dist/build/css/chunk-vendors.a16c4353.css +1 -0
  8. package/dist/build/favicon.ico +0 -0
  9. package/dist/build/fonts/element-icons.535877f5.woff +0 -0
  10. package/dist/build/fonts/element-icons.732389de.ttf +0 -0
  11. package/dist/build/img/t1.21b2c158.png +0 -0
  12. package/dist/build/img/t2.6991670f.png +0 -0
  13. package/dist/build/img/t3.49724600.png +0 -0
  14. package/dist/build/img/t4.4acb1808.png +0 -0
  15. package/dist/build/img/t5.e5e1948c.png +0 -0
  16. package/dist/build/img/t6.40836551.png +0 -0
  17. package/dist/build/img/t7.94cf1cc9.png +0 -0
  18. package/dist/build/img/t8.9291e9c1.png +0 -0
  19. package/dist/build/index.html +1 -0
  20. package/dist/build/js/app.dbcf7751.js +1 -0
  21. package/dist/build/js/chunk-1d66e3dd.7d669272.js +23 -0
  22. package/dist/build/js/chunk-vendors.be32fc27.js +24 -0
  23. package/dist/build/report.html +53 -0
  24. package/dist/lib/VFormDesigner.common-report.html +53 -0
  25. package/dist/lib/VFormDesigner.common.1.js +14583 -0
  26. package/dist/lib/VFormDesigner.common.1.js.map +1 -0
  27. package/dist/lib/VFormDesigner.common.js +71232 -0
  28. package/dist/lib/VFormDesigner.common.js.map +1 -0
  29. package/dist/lib/VFormDesigner.css +1 -0
  30. package/dist/lib/VFormDesigner.umd-report.html +53 -0
  31. package/dist/lib/VFormDesigner.umd.1.js +14583 -0
  32. package/dist/lib/VFormDesigner.umd.1.js.map +1 -0
  33. package/dist/lib/VFormDesigner.umd.js +71242 -0
  34. package/dist/lib/VFormDesigner.umd.js.map +1 -0
  35. package/dist/lib/VFormDesigner.umd.min-report.html +53 -0
  36. package/dist/lib/VFormDesigner.umd.min.1.js +23 -0
  37. package/dist/lib/VFormDesigner.umd.min.js +19 -0
  38. package/dist/lib/demo.html +10 -0
  39. package/dist/lib/img/t1.21b2c158.png +0 -0
  40. package/dist/lib/img/t2.6991670f.png +0 -0
  41. package/dist/lib/img/t3.49724600.png +0 -0
  42. package/dist/lib/img/t4.4acb1808.png +0 -0
  43. package/dist/lib/img/t5.e5e1948c.png +0 -0
  44. package/dist/lib/img/t6.40836551.png +0 -0
  45. package/dist/lib/img/t7.94cf1cc9.png +0 -0
  46. package/dist/lib/img/t8.9291e9c1.png +0 -0
  47. package/dist/lib-render/VFormRender.common-report.html +53 -0
  48. package/dist/lib-render/VFormRender.common.1.js +14583 -0
  49. package/dist/lib-render/VFormRender.common.1.js.map +1 -0
  50. package/dist/lib-render/VFormRender.common.js +32421 -0
  51. package/dist/lib-render/VFormRender.common.js.map +1 -0
  52. package/dist/lib-render/VFormRender.css +1 -0
  53. package/dist/lib-render/VFormRender.umd-report.html +53 -0
  54. package/dist/lib-render/VFormRender.umd.1.js +14583 -0
  55. package/dist/lib-render/VFormRender.umd.1.js.map +1 -0
  56. package/dist/lib-render/VFormRender.umd.js +32431 -0
  57. package/dist/lib-render/VFormRender.umd.js.map +1 -0
  58. package/dist/lib-render/VFormRender.umd.min-report.html +53 -0
  59. package/dist/lib-render/VFormRender.umd.min.1.js +23 -0
  60. package/dist/lib-render/VFormRender.umd.min.js +15 -0
  61. package/dist/lib-render/demo.html +10 -0
  62. package/index_template/index_dev.html +19 -0
  63. package/index_template/index_prod.html +28 -0
  64. package/index_template/vform_demo.gif +0 -0
  65. package/install-render.js +29 -0
  66. package/install.js +41 -0
  67. package/jsconfig.json +10 -0
  68. package/license.txt +8 -0
  69. package/package.json +58 -0
  70. package/public/favicon.ico +0 -0
  71. package/public/index.html +28 -0
  72. package/src/App.vue +22 -0
  73. package/src/assets/ft-images/t1.png +0 -0
  74. package/src/assets/ft-images/t2.png +0 -0
  75. package/src/assets/ft-images/t3.png +0 -0
  76. package/src/assets/ft-images/t4.png +0 -0
  77. package/src/assets/ft-images/t5.png +0 -0
  78. package/src/assets/ft-images/t6.png +0 -0
  79. package/src/assets/ft-images/t7.png +0 -0
  80. package/src/assets/ft-images/t8.png +0 -0
  81. package/src/assets/style.scss +92 -0
  82. package/src/assets/vform-logo.png +0 -0
  83. package/src/components/code-editor/index.vue +130 -0
  84. package/src/components/form-designer/designer.js +926 -0
  85. package/src/components/form-designer/form-widget/container-widget/container-wrapper.vue +107 -0
  86. package/src/components/form-designer/form-widget/container-widget/containerMixin.js +85 -0
  87. package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue +310 -0
  88. package/src/components/form-designer/form-widget/container-widget/grid-widget.vue +89 -0
  89. package/src/components/form-designer/form-widget/container-widget/index.js +24 -0
  90. package/src/components/form-designer/form-widget/container-widget/tab-widget.vue +119 -0
  91. package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue +341 -0
  92. package/src/components/form-designer/form-widget/container-widget/table-widget.vue +111 -0
  93. package/src/components/form-designer/form-widget/field-widget/button-widget.vue +87 -0
  94. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue +104 -0
  95. package/src/components/form-designer/form-widget/field-widget/checkbox-widget.vue +105 -0
  96. package/src/components/form-designer/form-widget/field-widget/color-widget.vue +99 -0
  97. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue +104 -0
  98. package/src/components/form-designer/form-widget/field-widget/date-widget.vue +103 -0
  99. package/src/components/form-designer/form-widget/field-widget/divider-widget.vue +83 -0
  100. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +535 -0
  101. package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue +271 -0
  102. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue +331 -0
  103. package/src/components/form-designer/form-widget/field-widget/html-text-widget.vue +82 -0
  104. package/src/components/form-designer/form-widget/field-widget/index.js +10 -0
  105. package/src/components/form-designer/form-widget/field-widget/input-widget.vue +112 -0
  106. package/src/components/form-designer/form-widget/field-widget/number-widget.vue +103 -0
  107. package/src/components/form-designer/form-widget/field-widget/picture-upload-widget.vue +226 -0
  108. package/src/components/form-designer/form-widget/field-widget/radio-widget.vue +105 -0
  109. package/src/components/form-designer/form-widget/field-widget/rate-widget.vue +102 -0
  110. package/src/components/form-designer/form-widget/field-widget/rich-editor-widget.vue +122 -0
  111. package/src/components/form-designer/form-widget/field-widget/select-widget.vue +115 -0
  112. package/src/components/form-designer/form-widget/field-widget/slider-widget.vue +100 -0
  113. package/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue +189 -0
  114. package/src/components/form-designer/form-widget/field-widget/static-text-widget.vue +82 -0
  115. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue +101 -0
  116. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue +99 -0
  117. package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue +104 -0
  118. package/src/components/form-designer/form-widget/field-widget/time-widget.vue +103 -0
  119. package/src/components/form-designer/form-widget/index.vue +260 -0
  120. package/src/components/form-designer/index.vue +448 -0
  121. package/src/components/form-designer/setting-panel/form-setting.vue +324 -0
  122. package/src/components/form-designer/setting-panel/index.vue +328 -0
  123. package/src/components/form-designer/setting-panel/option-items-setting.vue +234 -0
  124. package/src/components/form-designer/setting-panel/property-editor/allowCreate-editor.vue +24 -0
  125. package/src/components/form-designer/setting-panel/property-editor/appendButton-editor.vue +28 -0
  126. package/src/components/form-designer/setting-panel/property-editor/appendButtonDisabled-editor.vue +23 -0
  127. package/src/components/form-designer/setting-panel/property-editor/automaticDropdown-editor.vue +23 -0
  128. package/src/components/form-designer/setting-panel/property-editor/border-editor.vue +23 -0
  129. package/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +23 -0
  130. package/src/components/form-designer/setting-panel/property-editor/buttonStyle-editor.vue +23 -0
  131. package/src/components/form-designer/setting-panel/property-editor/clearable-editor.vue +23 -0
  132. package/src/components/form-designer/setting-panel/property-editor/columnWidth-editor.vue +40 -0
  133. package/src/components/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +28 -0
  134. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +81 -0
  135. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +24 -0
  136. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +24 -0
  137. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +24 -0
  138. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-responsive-editor.vue +23 -0
  139. package/src/components/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +48 -0
  140. package/src/components/form-designer/setting-panel/property-editor/container-sub-form/showBlankRow-editor.vue +23 -0
  141. package/src/components/form-designer/setting-panel/property-editor/container-sub-form/showRowNumber-editor.vue +23 -0
  142. package/src/components/form-designer/setting-panel/property-editor/container-sub-form/sub-form-labelAlign-editor.vue +36 -0
  143. package/src/components/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -0
  144. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +23 -0
  145. package/src/components/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +23 -0
  146. package/src/components/form-designer/setting-panel/property-editor/customClass-editor.vue +40 -0
  147. package/src/components/form-designer/setting-panel/property-editor/defaultValue-editor.vue +25 -0
  148. package/src/components/form-designer/setting-panel/property-editor/disabled-editor.vue +23 -0
  149. package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue +26 -0
  150. package/src/components/form-designer/setting-panel/property-editor/editable-editor.vue +24 -0
  151. package/src/components/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +23 -0
  152. package/src/components/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +12 -0
  153. package/src/components/form-designer/setting-panel/property-editor/event-handler/onBeforeUpload-editor.vue +30 -0
  154. package/src/components/form-designer/setting-panel/property-editor/event-handler/onBlur-editor.vue +30 -0
  155. package/src/components/form-designer/setting-panel/property-editor/event-handler/onChange-editor.vue +30 -0
  156. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +30 -0
  157. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue +31 -0
  158. package/src/components/form-designer/setting-panel/property-editor/event-handler/onFocus-editor.vue +30 -0
  159. package/src/components/form-designer/setting-panel/property-editor/event-handler/onInput-editor.vue +30 -0
  160. package/src/components/form-designer/setting-panel/property-editor/event-handler/onMounted-editor.vue +30 -0
  161. package/src/components/form-designer/setting-panel/property-editor/event-handler/onRemoteQuery-editor.vue +30 -0
  162. package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowAdd-editor.vue +30 -0
  163. package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowChange-editor.vue +30 -0
  164. package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowDelete-editor.vue +30 -0
  165. package/src/components/form-designer/setting-panel/property-editor/event-handler/onSubFormRowInsert-editor.vue +30 -0
  166. package/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadError-editor.vue +30 -0
  167. package/src/components/form-designer/setting-panel/property-editor/event-handler/onUploadSuccess-editor.vue +30 -0
  168. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue +30 -0
  169. package/src/components/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +32 -0
  170. package/src/components/form-designer/setting-panel/property-editor/field-button/circle-editor.vue +23 -0
  171. package/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +23 -0
  172. package/src/components/form-designer/setting-panel/property-editor/field-button/plain-editor.vue +24 -0
  173. package/src/components/form-designer/setting-panel/property-editor/field-button/round-editor.vue +23 -0
  174. package/src/components/form-designer/setting-panel/property-editor/field-color/color-defaultValue-editor.vue +23 -0
  175. package/src/components/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +24 -0
  176. package/src/components/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +30 -0
  177. package/src/components/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +30 -0
  178. package/src/components/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +26 -0
  179. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +24 -0
  180. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +30 -0
  181. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +27 -0
  182. package/src/components/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +26 -0
  183. package/src/components/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +27 -0
  184. package/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -0
  185. package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +23 -0
  186. package/src/components/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +27 -0
  187. package/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +43 -0
  188. package/src/components/form-designer/setting-panel/property-editor/field-rate/allowHalf-editor.vue +23 -0
  189. package/src/components/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +24 -0
  190. package/src/components/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +24 -0
  191. package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +26 -0
  192. package/src/components/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +25 -0
  193. package/src/components/form-designer/setting-panel/property-editor/field-rate/showScore-editor.vue +23 -0
  194. package/src/components/form-designer/setting-panel/property-editor/field-rate/showText-editor.vue +23 -0
  195. package/src/components/form-designer/setting-panel/property-editor/field-slider/range-editor.vue +23 -0
  196. package/src/components/form-designer/setting-panel/property-editor/field-slider/showStops-editor.vue +23 -0
  197. package/src/components/form-designer/setting-panel/property-editor/field-slider/vertical-editor.vue +23 -0
  198. package/src/components/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +23 -0
  199. package/src/components/form-designer/setting-panel/property-editor/field-switch/activeColor-editor.vue +23 -0
  200. package/src/components/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +23 -0
  201. package/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveColor-editor.vue +23 -0
  202. package/src/components/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +23 -0
  203. package/src/components/form-designer/setting-panel/property-editor/field-switch/switch-defaultValue-editor.vue +25 -0
  204. package/src/components/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +23 -0
  205. package/src/components/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +24 -0
  206. package/src/components/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +27 -0
  207. package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +24 -0
  208. package/src/components/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +27 -0
  209. package/src/components/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +23 -0
  210. package/src/components/form-designer/setting-panel/property-editor/filterable-editor.vue +23 -0
  211. package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue +23 -0
  212. package/src/components/form-designer/setting-panel/property-editor/index.js +10 -0
  213. package/src/components/form-designer/setting-panel/property-editor/label-editor.vue +30 -0
  214. package/src/components/form-designer/setting-panel/property-editor/labelAlign-editor.vue +42 -0
  215. package/src/components/form-designer/setting-panel/property-editor/labelHidden-editor.vue +23 -0
  216. package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +28 -0
  217. package/src/components/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +37 -0
  218. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +23 -0
  219. package/src/components/form-designer/setting-panel/property-editor/labelWidth-editor.vue +25 -0
  220. package/src/components/form-designer/setting-panel/property-editor/limit-editor.vue +24 -0
  221. package/src/components/form-designer/setting-panel/property-editor/max-editor.vue +39 -0
  222. package/src/components/form-designer/setting-panel/property-editor/maxLength-editor.vue +40 -0
  223. package/src/components/form-designer/setting-panel/property-editor/min-editor.vue +40 -0
  224. package/src/components/form-designer/setting-panel/property-editor/minLength-editor.vue +41 -0
  225. package/src/components/form-designer/setting-panel/property-editor/multiple-editor.vue +24 -0
  226. package/src/components/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +24 -0
  227. package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue +24 -0
  228. package/src/components/form-designer/setting-panel/property-editor/name-editor.vue +80 -0
  229. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue +28 -0
  230. package/src/components/form-designer/setting-panel/property-editor/placeholder-editor.vue +24 -0
  231. package/src/components/form-designer/setting-panel/property-editor/precision-editor.vue +23 -0
  232. package/src/components/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +23 -0
  233. package/src/components/form-designer/setting-panel/property-editor/propertyMixin.js +47 -0
  234. package/src/components/form-designer/setting-panel/property-editor/readonly-editor.vue +23 -0
  235. package/src/components/form-designer/setting-panel/property-editor/remote-editor.vue +25 -0
  236. package/src/components/form-designer/setting-panel/property-editor/required-editor.vue +23 -0
  237. package/src/components/form-designer/setting-panel/property-editor/rows-editor.vue +24 -0
  238. package/src/components/form-designer/setting-panel/property-editor/showFileList-editor.vue +23 -0
  239. package/src/components/form-designer/setting-panel/property-editor/showPassword-editor.vue +24 -0
  240. package/src/components/form-designer/setting-panel/property-editor/showWordLimit-editor.vue +23 -0
  241. package/src/components/form-designer/setting-panel/property-editor/size-editor.vue +38 -0
  242. package/src/components/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +23 -0
  243. package/src/components/form-designer/setting-panel/property-editor/step-editor.vue +23 -0
  244. package/src/components/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +23 -0
  245. package/src/components/form-designer/setting-panel/property-editor/type-editor.vue +33 -0
  246. package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue +24 -0
  247. package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue +28 -0
  248. package/src/components/form-designer/setting-panel/property-editor/validation-editor.vue +48 -0
  249. package/src/components/form-designer/setting-panel/property-editor/validationHint-editor.vue +23 -0
  250. package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue +23 -0
  251. package/src/components/form-designer/setting-panel/property-editor-factory.js +173 -0
  252. package/src/components/form-designer/setting-panel/propertyRegister.js +198 -0
  253. package/src/components/form-designer/toolbar-panel/index.vue +1070 -0
  254. package/src/components/form-designer/widget-panel/index.vue +530 -0
  255. package/src/components/form-designer/widget-panel/templatesConfig.js +58 -0
  256. package/src/components/form-designer/widget-panel/widgetsConfig.js +966 -0
  257. package/src/components/form-render/container-item/container-item-wrapper.vue +34 -0
  258. package/src/components/form-render/container-item/containerItemMixin.js +136 -0
  259. package/src/components/form-render/container-item/grid-col-item.vue +115 -0
  260. package/src/components/form-render/container-item/grid-item.vue +54 -0
  261. package/src/components/form-render/container-item/index.js +24 -0
  262. package/src/components/form-render/container-item/sub-form-item.vue +405 -0
  263. package/src/components/form-render/container-item/tab-item.vue +89 -0
  264. package/src/components/form-render/container-item/table-cell-item.vue +61 -0
  265. package/src/components/form-render/container-item/table-item.vue +65 -0
  266. package/src/components/form-render/index.vue +712 -0
  267. package/src/components/form-render/refMixin.js +22 -0
  268. package/src/components/svg-icon/index.vue +49 -0
  269. package/src/components/v-table/index.vue +106 -0
  270. package/src/extension/extension-helper.js +23 -0
  271. package/src/extension/extension-loader.js +112 -0
  272. package/src/extension/samples/alert/alert-widget.vue +72 -0
  273. package/src/extension/samples/card/card-item.vue +90 -0
  274. package/src/extension/samples/card/card-widget.vue +119 -0
  275. package/src/extension/samples/extension-schema.js +36 -0
  276. package/src/extension/samples/extension-sfc-generator.js +50 -0
  277. package/src/iconfont/iconfont.css +29 -0
  278. package/src/iconfont/iconfont.eot +0 -0
  279. package/src/iconfont/iconfont.js +1 -0
  280. package/src/iconfont/iconfont.json +37 -0
  281. package/src/iconfont/iconfont.svg +35 -0
  282. package/src/iconfont/iconfont.ttf +0 -0
  283. package/src/iconfont/iconfont.woff +0 -0
  284. package/src/iconfont/iconfont.woff2 +0 -0
  285. package/src/icons/index.js +9 -0
  286. package/src/icons/svg/alert.svg +1 -0
  287. package/src/icons/svg/button.svg +1 -0
  288. package/src/icons/svg/card.svg +1 -0
  289. package/src/icons/svg/cascader-field.svg +1 -0
  290. package/src/icons/svg/checkbox-field.svg +1 -0
  291. package/src/icons/svg/color-field.svg +1 -0
  292. package/src/icons/svg/custom-component.svg +1 -0
  293. package/src/icons/svg/data-table.svg +1 -0
  294. package/src/icons/svg/date-field.svg +1 -0
  295. package/src/icons/svg/date-range-field.svg +1 -0
  296. package/src/icons/svg/divider.svg +1 -0
  297. package/src/icons/svg/document.svg +1 -0
  298. package/src/icons/svg/drag.svg +1 -0
  299. package/src/icons/svg/file-upload-field.svg +1 -0
  300. package/src/icons/svg/github.svg +1 -0
  301. package/src/icons/svg/grid.svg +1 -0
  302. package/src/icons/svg/html-text.svg +1 -0
  303. package/src/icons/svg/node-tree.svg +1 -0
  304. package/src/icons/svg/number-field.svg +1 -0
  305. package/src/icons/svg/picture-upload-field.svg +1 -0
  306. package/src/icons/svg/radio-field.svg +1 -0
  307. package/src/icons/svg/rate-field.svg +1 -0
  308. package/src/icons/svg/redo.svg +1 -0
  309. package/src/icons/svg/rich-editor-field.svg +1 -0
  310. package/src/icons/svg/section.svg +1 -0
  311. package/src/icons/svg/select-field.svg +1 -0
  312. package/src/icons/svg/slider-field.svg +1 -0
  313. package/src/icons/svg/slot-component.svg +1 -0
  314. package/src/icons/svg/static-text.svg +1 -0
  315. package/src/icons/svg/sub-form.svg +1 -0
  316. package/src/icons/svg/switch-field.svg +1 -0
  317. package/src/icons/svg/tab.svg +1 -0
  318. package/src/icons/svg/table.svg +1 -0
  319. package/src/icons/svg/text-field.svg +1 -0
  320. package/src/icons/svg/textarea-field.svg +1 -0
  321. package/src/icons/svg/time-field.svg +1 -0
  322. package/src/icons/svg/time-range-field.svg +1 -0
  323. package/src/icons/svg/undo.svg +1 -0
  324. package/src/icons/svg/vue-sfc.svg +1 -0
  325. package/src/index.js +41 -0
  326. package/src/lang/en-US.js +321 -0
  327. package/src/lang/en-US_extension.js +26 -0
  328. package/src/lang/en-US_render.js +38 -0
  329. package/src/lang/zh-CN.js +321 -0
  330. package/src/lang/zh-CN_extension.js +26 -0
  331. package/src/lang/zh-CN_render.js +38 -0
  332. package/src/main.js +29 -0
  333. package/src/styles/global.scss +103 -0
  334. package/src/styles/index.scss +15 -0
  335. package/src/utils/beautifierLoader.js +77 -0
  336. package/src/utils/code-generator.js +91 -0
  337. package/src/utils/config.js +19 -0
  338. package/src/utils/debug-console.js +7 -0
  339. package/src/utils/directive.js +74 -0
  340. package/src/utils/i18n.js +70 -0
  341. package/src/utils/sfc-generator.js +583 -0
  342. package/src/utils/util.js +232 -0
  343. package/src/utils/validators.js +127 -0
  344. package/src/utils/vue2js-generator.js +144 -0
  345. package/src/utils/vue3js-generator.js +70 -0
  346. package/vue.config.js +92 -0
@@ -0,0 +1,107 @@
1
+ <!--
2
+ /**
3
+ * author: vformAdmin
4
+ * email: vdpadmin@163.com
5
+ * website: https://www.vform666.com
6
+ * date: 2021.08.18
7
+ * remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!!
8
+ */
9
+ -->
10
+
11
+ <template>
12
+ <div class="container-wrapper" :class="[customClass]">
13
+ <slot></slot>
14
+
15
+ <div class="container-action" v-if="designer.selectedId === widget.id && !widget.internal">
16
+ <i class="el-icon-back" :title="i18nt('designer.hint.selectParentWidget')"
17
+ @click.stop="selectParentWidget(widget)"></i>
18
+ <i class="el-icon-top" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveUpWidget')"
19
+ @click.stop="moveUpWidget()"></i>
20
+ <i class="el-icon-bottom" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveDownWidget')"
21
+ @click.stop="moveDownWidget()"></i>
22
+ <i v-if="widget.type === 'table'" class="iconfont icon-insertrow" :title="i18nt('designer.hint.insertRow')"
23
+ @click.stop="insertTableRow(widget)"></i>
24
+ <i v-if="widget.type === 'table'" class="iconfont icon-insertcolumn" :title="i18nt('designer.hint.insertColumn')"
25
+ @click.stop="insertTableCol(widget)"></i>
26
+ <i class="el-icon-copy-document" v-if="(widget.type === 'grid') || (widget.type === 'table')"
27
+ :title="i18nt('designer.hint.cloneWidget')" @click.stop="cloneContainer(widget)"></i>
28
+ <i class="el-icon-delete" :title="i18nt('designer.hint.remove')" @click.stop="removeWidget"></i>
29
+ </div>
30
+
31
+ <div class="drag-handler" v-if="designer.selectedId === widget.id && !widget.internal">
32
+ <i class="el-icon-rank" :title="i18nt('designer.hint.dragHandler')"></i>
33
+ <i>{{i18n2t(`designer.widgetLabel.${widget.type}`, `extension.widgetLabel.${widget.type}`)}}</i>
34
+ <i v-if="widget.options.hidden === true" class="iconfont icon-hide"></i>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ import i18n from "@/utils/i18n";
41
+ import containerMixin from "@/components/form-designer/form-widget/container-widget/containerMixin";
42
+
43
+ export default {
44
+ name: "container-wrapper",
45
+ mixins: [i18n, containerMixin],
46
+ props: {
47
+ widget: Object,
48
+ parentWidget: Object,
49
+ parentList: Array,
50
+ indexOfParentList: Number,
51
+ designer: Object,
52
+ },
53
+ computed: {
54
+ customClass() {
55
+ return !!this.widget.options.customClass ? this.widget.options.customClass.join(' ') : ''
56
+ },
57
+
58
+ }
59
+ }
60
+ </script>
61
+
62
+ <style lang="scss" scoped>
63
+ .container-wrapper {
64
+ position: relative;
65
+ margin-bottom: 5px;
66
+
67
+ .container-action{
68
+ position: absolute;
69
+ //bottom: -30px;
70
+ bottom: 0;
71
+ right: -2px;
72
+ height: 28px;
73
+ line-height: 28px;
74
+ background: $--color-primary;
75
+ z-index: 999;
76
+
77
+ i {
78
+ font-size: 14px;
79
+ color: #fff;
80
+ margin: 0 5px;
81
+ cursor: pointer;
82
+ }
83
+ }
84
+
85
+ .drag-handler {
86
+ position: absolute;
87
+ top: -2px;
88
+ //bottom: -24px; /* 拖拽手柄位于组件下方,有时无法正常拖动,原因未明?? */
89
+ left: -2px;
90
+ height: 22px;
91
+ line-height: 22px;
92
+ background: $--color-primary;
93
+ z-index: 9;
94
+
95
+ i {
96
+ font-size: 14px;
97
+ font-style: normal;
98
+ color: #fff;
99
+ margin: 4px;
100
+ cursor: move;
101
+ }
102
+ }
103
+
104
+ }
105
+
106
+
107
+ </style>
@@ -0,0 +1,85 @@
1
+ export default {
2
+ methods: {
3
+ appendTableRow(widget) {
4
+ this.designer.appendTableRow(widget)
5
+ },
6
+
7
+ appendTableCol(widget) {
8
+ this.designer.appendTableCol(widget)
9
+ },
10
+
11
+ onContainerDragAdd(evt, subList) {
12
+ const newIndex = evt.newIndex
13
+ if (!!subList[newIndex]) {
14
+ this.designer.setSelected( subList[newIndex] )
15
+ }
16
+
17
+ this.designer.emitHistoryChange()
18
+ },
19
+
20
+ onContainerDragUpdate() {
21
+ this.designer.emitHistoryChange()
22
+ },
23
+
24
+ checkContainerMove(evt) {
25
+ return this.designer.checkWidgetMove(evt)
26
+ },
27
+
28
+ selectWidget(widget) {
29
+ this.designer.setSelected(widget)
30
+ },
31
+
32
+ selectParentWidget() {
33
+ if (this.parentWidget) {
34
+ this.designer.setSelected(this.parentWidget)
35
+ } else {
36
+ this.designer.clearSelected()
37
+ }
38
+ },
39
+
40
+ moveUpWidget() {
41
+ this.designer.moveUpWidget(this.parentList, this.indexOfParentList)
42
+ this.designer.emitHistoryChange()
43
+ },
44
+
45
+ moveDownWidget() {
46
+ this.designer.moveDownWidget(this.parentList, this.indexOfParentList)
47
+ this.designer.emitHistoryChange()
48
+ },
49
+
50
+ cloneContainer(widget) {
51
+ if (!!this.parentList) {
52
+ let newCon = this.designer.cloneContainer(widget)
53
+ this.parentList.splice(this.indexOfParentList + 1, 0, newCon)
54
+ this.designer.setSelected(newCon)
55
+
56
+ this.designer.emitHistoryChange()
57
+ }
58
+ },
59
+
60
+ removeWidget() {
61
+ if (!!this.parentList) {
62
+ let nextSelected = null
63
+ if (this.parentList.length === 1) {
64
+ if (!!this.parentWidget) {
65
+ nextSelected = this.parentWidget
66
+ }
67
+ } else if (this.parentList.length === (1 + this.indexOfParentList)) {
68
+ nextSelected = this.parentList[this.indexOfParentList - 1]
69
+ } else {
70
+ nextSelected = this.parentList[this.indexOfParentList + 1]
71
+ }
72
+
73
+ this.$nextTick(() => {
74
+ this.parentList.splice(this.indexOfParentList, 1)
75
+ //if (!!nextSelected) {
76
+ this.designer.setSelected(nextSelected)
77
+ //}
78
+
79
+ this.designer.emitHistoryChange()
80
+ })
81
+ }
82
+ },
83
+
84
+ }
85
+ }
@@ -0,0 +1,310 @@
1
+ <template>
2
+ <el-col v-else-if="widget.type === 'grid-col'" class="grid-cell" v-bind="layoutProps"
3
+ :class="[selected ? 'selected' : '', customClass]" :style="colHeightStyle"
4
+ :key="widget.id" @click.native.stop="selectWidget(widget)">
5
+ <draggable :list="widget.widgetList" v-bind="{group:'dragGroup', ghostClass: 'ghost',animation: 200}"
6
+ handle=".drag-handler" @end="(evt) => onGridDragEnd(evt, widget.widgetList)"
7
+ @add="(evt) => onGridDragAdd(evt, widget.widgetList)"
8
+ @update="onGridDragUpdate" :move="checkContainerMove">
9
+ <transition-group name="fade" tag="div" class="form-widget-list">
10
+ <template v-for="(subWidget, swIdx) in widget.widgetList">
11
+ <template v-if="'container' === subWidget.category">
12
+ <component :is="subWidget.type + '-widget'" :widget="subWidget" :designer="designer" :key="subWidget.id" :parent-list="widget.widgetList"
13
+ :index-of-parent-list="swIdx" :parent-widget="widget"></component>
14
+ </template>
15
+ <template v-else>
16
+ <component :is="subWidget.type + '-widget'" :field="subWidget" :designer="designer" :key="subWidget.id" :parent-list="widget.widgetList"
17
+ :index-of-parent-list="swIdx" :parent-widget="widget" :design-state="true"></component>
18
+ </template>
19
+ </template>
20
+ </transition-group>
21
+ </draggable>
22
+
23
+ <div class="grid-col-action" v-if="designer.selectedId === widget.id && widget.type === 'grid-col'">
24
+ <i class="el-icon-back" :title="i18nt('designer.hint.selectParentWidget')"
25
+ @click.stop="selectParentWidget(widget)"></i>
26
+ <i class="el-icon-top" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveUpWidget')"
27
+ @click.stop="moveUpWidget()"></i>
28
+ <i class="el-icon-bottom" v-if="!!parentList && (parentList.length > 1)" :title="i18nt('designer.hint.moveDownWidget')"
29
+ @click.stop="moveDownWidget()"></i>
30
+ <i class="el-icon-copy-document" :title="i18nt('designer.hint.cloneWidget')" @click.stop="cloneGridCol(widget)"></i>
31
+ <i class="el-icon-delete" :title="i18nt('designer.hint.remove')" @click.stop="removeWidget"></i>
32
+ </div>
33
+
34
+ <div class="grid-col-handler" v-if="designer.selectedId === widget.id && widget.type === 'grid-col'">
35
+ <i>{{i18nt('designer.widgetLabel.' + widget.type)}}</i>
36
+ </div>
37
+ </el-col>
38
+ </template>
39
+
40
+ <script>
41
+ import Draggable from 'vuedraggable'
42
+ import i18n from "@/utils/i18n";
43
+ import FieldComponents from '@/components/form-designer/form-widget/field-widget/index'
44
+
45
+ export default {
46
+ name: "GridColWidget",
47
+ componentName: "GridColWidget",
48
+ mixins: [i18n],
49
+ components: {
50
+ Draggable,
51
+ ...FieldComponents,
52
+ },
53
+ props: {
54
+ widget: Object,
55
+ parentWidget: Object,
56
+ parentList: Array,
57
+ indexOfParentList: Number,
58
+ designer: Object,
59
+
60
+ colHeight: {
61
+ type: String,
62
+ default: null
63
+ },
64
+
65
+ },
66
+ data() {
67
+ return {
68
+ layoutProps: {
69
+ span: this.widget.options.span || 12,
70
+ // md: this.widget.options.md || 12,
71
+ // sm: this.widget.options.sm || 12,
72
+ // xs: this.widget.options.xs || 12,
73
+ offset: this.widget.options.offset || 0,
74
+ push: this.widget.options.push || 0,
75
+ pull: this.widget.options.pull || 0,
76
+ }
77
+ }
78
+ },
79
+ computed: {
80
+ selected() {
81
+ return this.widget.id === this.designer.selectedId
82
+ },
83
+
84
+ customClass() {
85
+ return this.widget.options.customClass || ''
86
+ },
87
+
88
+ colHeightStyle() {
89
+ return !!this.colHeight ? {height: this.colHeight + 'px'} : {}
90
+ },
91
+
92
+ },
93
+ watch: {
94
+ 'designer.formConfig.layoutType': {
95
+ handler(val) {
96
+ if (!!this.widget.options.responsive) {
97
+ if (val === 'H5') {
98
+ this.layoutProps.span = this.widget.options.xs || 12
99
+ } else if (val === 'Pad') {
100
+ this.layoutProps.span = this.widget.options.sm || 12
101
+ } else {
102
+ this.layoutProps.span = this.widget.options.md || 12
103
+ }
104
+ } else {
105
+ this.layoutProps.span = this.widget.options.span || 12
106
+ }
107
+ }
108
+ },
109
+
110
+ 'widget.options.responsive': {
111
+ handler(val) {
112
+ let lyType = this.designer.formConfig.layoutType
113
+ if (!!val) {
114
+ if (lyType === 'H5') {
115
+ this.layoutProps.span = this.widget.options.xs || 12
116
+ } else if (lyType === 'Pad') {
117
+ this.layoutProps.span = this.widget.options.sm || 12
118
+ } else {
119
+ this.layoutProps.span = this.widget.options.md || 12
120
+ }
121
+ } else {
122
+ this.layoutProps.span = this.widget.options.span || 12
123
+ }
124
+ }
125
+ },
126
+
127
+ 'widget.options.span': {
128
+ handler(val) {
129
+ this.layoutProps.span = val
130
+ }
131
+ },
132
+
133
+ 'widget.options.md': {
134
+ handler(val) {
135
+ this.layoutProps.span = val
136
+ }
137
+ },
138
+
139
+ 'widget.options.sm': {
140
+ handler(val) {
141
+ this.layoutProps.span = val
142
+ }
143
+ },
144
+
145
+ 'widget.options.xs': {
146
+ handler(val) {
147
+ this.layoutProps.span = val
148
+ }
149
+ },
150
+
151
+ 'widget.options.offset': {
152
+ handler(val) {
153
+ this.layoutProps.offset = val
154
+ }
155
+ },
156
+
157
+ 'widget.options.push': {
158
+ handler(val) {
159
+ this.layoutProps.push = val
160
+ }
161
+ },
162
+
163
+ 'widget.options.pull': {
164
+ handler(val) {
165
+ this.layoutProps.pull = val
166
+ }
167
+ },
168
+
169
+ },
170
+ created() {
171
+ this.initLayoutProps()
172
+ },
173
+ methods: {
174
+ initLayoutProps() {
175
+ if (!!this.widget.options.responsive) {
176
+ let lyType = this.designer.formConfig.layoutType
177
+ if (lyType === 'H5') {
178
+ this.layoutProps.span = this.widget.options.xs || 12
179
+ } else if (lyType === 'Pad') {
180
+ this.layoutProps.span = this.widget.options.sm || 12
181
+ } else {
182
+ this.layoutProps.span = this.widget.options.md || 12
183
+ }
184
+ } else {
185
+ this.layoutProps.spn = this.widget.options.span
186
+ }
187
+ },
188
+
189
+ onGridDragEnd(evt, subList) {
190
+ //
191
+ },
192
+
193
+ onGridDragAdd(evt, subList) {
194
+ const newIndex = evt.newIndex
195
+ if (!!subList[newIndex]) {
196
+ this.designer.setSelected( subList[newIndex] )
197
+ }
198
+
199
+ this.designer.emitHistoryChange()
200
+ },
201
+
202
+ onGridDragUpdate() {
203
+ this.designer.emitHistoryChange()
204
+ },
205
+
206
+ selectWidget(widget) {
207
+ console.log('id: ' + widget.id)
208
+ this.designer.setSelected(widget)
209
+ },
210
+
211
+ checkContainerMove(evt) {
212
+ return this.designer.checkWidgetMove(evt)
213
+ },
214
+
215
+ selectParentWidget() {
216
+ if (this.parentWidget) {
217
+ this.designer.setSelected(this.parentWidget)
218
+ } else {
219
+ this.designer.clearSelected()
220
+ }
221
+ },
222
+
223
+ moveUpWidget() {
224
+ this.designer.moveUpWidget(this.parentList, this.indexOfParentList)
225
+ },
226
+
227
+ moveDownWidget() {
228
+ this.designer.moveDownWidget(this.parentList, this.indexOfParentList)
229
+ },
230
+
231
+ cloneGridCol(widget) {
232
+ this.designer.cloneGridCol(widget, this.parentWidget)
233
+ },
234
+
235
+ removeWidget() {
236
+ if (!!this.parentList) {
237
+ let nextSelected = null
238
+ if (this.parentList.length === 1) {
239
+ if (!!this.parentWidget) {
240
+ nextSelected = this.parentWidget
241
+ }
242
+ } else if (this.parentList.length === (1 + this.indexOfParentList)) {
243
+ nextSelected = this.parentList[this.indexOfParentList - 1]
244
+ } else {
245
+ nextSelected = this.parentList[this.indexOfParentList + 1]
246
+ }
247
+
248
+ this.$nextTick(() => {
249
+ this.parentList.splice(this.indexOfParentList, 1)
250
+ //if (!!nextSelected) {
251
+ this.designer.setSelected(nextSelected)
252
+ //}
253
+
254
+ this.designer.emitHistoryChange()
255
+ })
256
+ }
257
+ },
258
+
259
+ }
260
+ }
261
+ </script>
262
+
263
+ <style lang="scss" scoped>
264
+ .grid-cell {
265
+ min-height: 38px;
266
+ //margin: 6px 0; /* 设置了margin,栅格列的offset、push、pull会失效!! */
267
+ padding: 3px;
268
+ outline: 1px dashed #336699;
269
+ position: relative;
270
+
271
+ .form-widget-list {
272
+ min-height: 28px;
273
+ }
274
+
275
+ .grid-col-action{
276
+ position: absolute;
277
+ bottom: 0;
278
+ right: -2px;
279
+ height: 28px;
280
+ line-height: 28px;
281
+ background: $--color-primary;
282
+ z-index: 999;
283
+
284
+ i {
285
+ font-size: 14px;
286
+ color: #fff;
287
+ margin: 0 5px;
288
+ cursor: pointer;
289
+ }
290
+ }
291
+
292
+ .grid-col-handler {
293
+ position: absolute;
294
+ top: -2px;
295
+ left: -2px;
296
+ height: 22px;
297
+ line-height: 22px;
298
+ background: $--color-primary;
299
+ z-index: 9;
300
+
301
+ i {
302
+ font-size: 14px;
303
+ font-style: normal;
304
+ color: #fff;
305
+ margin: 4px;
306
+ cursor: default;
307
+ }
308
+ }
309
+ }
310
+ </style>
@@ -0,0 +1,89 @@
1
+ <!--
2
+ /**
3
+ * author: vformAdmin
4
+ * email: vdpadmin@163.com
5
+ * website: https://www.vform666.com
6
+ * date: 2021.08.18
7
+ * remark: 如果要分发VForm源码,需在本文件顶部保留此文件头信息!!
8
+ */
9
+ -->
10
+
11
+ <template>
12
+ <container-wrapper :designer="designer" :widget="widget" :parent-widget="parentWidget" :parent-list="parentList"
13
+ :index-of-parent-list="indexOfParentList">
14
+
15
+ <el-row :key="widget.id" :gutter="widget.options.gutter" class="grid-container"
16
+ :class="[selected ? 'selected' : '', customClass]"
17
+ @click.native.stop="selectWidget(widget)">
18
+ <template v-for="(colWidget, colIdx) in widget.cols">
19
+ <grid-col-widget :widget="colWidget" :designer="designer" :key="colWidget.id" :parent-list="widget.cols"
20
+ :index-of-parent-list="colIdx" :parent-widget="widget"
21
+ :col-height="widget.options.colHeight"></grid-col-widget>
22
+ </template>
23
+ </el-row>
24
+
25
+ </container-wrapper>
26
+ </template>
27
+
28
+ <script>
29
+ import i18n from "@/utils/i18n"
30
+ import GridColWidget from "@/components/form-designer/form-widget/container-widget/grid-col-widget"
31
+ import containerMixin from "@/components/form-designer/form-widget/container-widget/containerMixin";
32
+ import ContainerWrapper from "@/components/form-designer/form-widget/container-widget/container-wrapper";
33
+
34
+ export default {
35
+ name: "grid-widget",
36
+ componentName: 'ContainerWidget',
37
+ mixins: [i18n, containerMixin],
38
+ components: {
39
+ ContainerWrapper,
40
+ GridColWidget
41
+ },
42
+ props: {
43
+ widget: Object,
44
+ parentWidget: Object,
45
+ parentList: Array,
46
+ indexOfParentList: Number,
47
+ designer: Object,
48
+ },
49
+ computed: {
50
+ selected() {
51
+ return this.widget.id === this.designer.selectedId
52
+ },
53
+
54
+ customClass() {
55
+ return this.widget.options.customClass || ''
56
+ },
57
+
58
+ },
59
+ watch: {
60
+ //
61
+ },
62
+ mounted() {
63
+ //
64
+ },
65
+ methods: {
66
+
67
+
68
+ }
69
+ }
70
+ </script>
71
+
72
+ <style lang="scss" scoped>
73
+ .el-row.grid-container {
74
+ min-height: 50px;
75
+ //line-height: 48px;
76
+ //padding: 6px;
77
+ outline: 1px dashed #336699;
78
+
79
+ .form-widget-list {
80
+ min-height: 28px;
81
+ }
82
+
83
+ }
84
+
85
+ .grid-container.selected, .grid-cell.selected {
86
+ outline: 2px solid $--color-primary !important;
87
+ }
88
+
89
+ </style>
@@ -0,0 +1,24 @@
1
+ import Vue from 'vue'
2
+
3
+ const requireComponent = require.context('./', false, /\w+\.vue$/)
4
+
5
+ /**
6
+ * 容器组件时递归组件,且内部可以嵌套其他容器,局部注册会找不到组件,必须注册为全局组件,原因不明?!
7
+ * begin
8
+ *
9
+ let comps = {}
10
+
11
+ requireComponent.keys().map(fileName => {
12
+ let comp = requireComponent(fileName).default;
13
+ comps[comp.name] = comp
14
+ })
15
+
16
+ export default comps;
17
+
18
+ end */
19
+
20
+ /* 全局注册!! */
21
+ requireComponent.keys().map(fileName => {
22
+ let comp = requireComponent(fileName).default;
23
+ Vue.component(comp.name, comp)
24
+ })