m8-mcp-server 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +153 -30
  2. package/dist/cli.d.ts +9 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +14 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/docs/apis.d.ts +38 -0
  7. package/dist/docs/apis.d.ts.map +1 -0
  8. package/dist/docs/apis.js +326 -0
  9. package/dist/docs/apis.js.map +1 -0
  10. package/dist/docs/components.d.ts +45 -0
  11. package/dist/docs/components.d.ts.map +1 -0
  12. package/dist/docs/components.js +186 -0
  13. package/dist/docs/components.js.map +1 -0
  14. package/dist/docs/index.d.ts +94 -0
  15. package/dist/docs/index.d.ts.map +1 -0
  16. package/dist/docs/index.js +182 -0
  17. package/dist/docs/index.js.map +1 -0
  18. package/dist/docs/loader.d.ts +51 -0
  19. package/dist/docs/loader.d.ts.map +1 -0
  20. package/dist/docs/loader.js +165 -0
  21. package/dist/docs/loader.js.map +1 -0
  22. package/dist/docs/search.d.ts +28 -0
  23. package/dist/docs/search.d.ts.map +1 -0
  24. package/dist/docs/search.js +196 -0
  25. package/dist/docs/search.js.map +1 -0
  26. package/dist/docs/standards.d.ts +41 -0
  27. package/dist/docs/standards.d.ts.map +1 -0
  28. package/dist/docs/standards.js +134 -0
  29. package/dist/docs/standards.js.map +1 -0
  30. package/dist/docs/utils.d.ts +46 -0
  31. package/dist/docs/utils.d.ts.map +1 -0
  32. package/dist/docs/utils.js +129 -0
  33. package/dist/docs/utils.js.map +1 -0
  34. package/dist/generator/header.d.ts +32 -0
  35. package/dist/generator/header.d.ts.map +1 -0
  36. package/dist/generator/header.js +83 -0
  37. package/dist/generator/header.js.map +1 -0
  38. package/dist/generator/index.d.ts +50 -0
  39. package/dist/generator/index.d.ts.map +1 -0
  40. package/dist/generator/index.js +387 -0
  41. package/dist/generator/index.js.map +1 -0
  42. package/dist/generator/vue-template.d.ts +54 -0
  43. package/dist/generator/vue-template.d.ts.map +1 -0
  44. package/dist/generator/vue-template.js +191 -0
  45. package/dist/generator/vue-template.js.map +1 -0
  46. package/dist/index.d.ts +21 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +73 -1
  49. package/dist/index.js.map +1 -0
  50. package/dist/recommend/index.d.ts +27 -0
  51. package/dist/recommend/index.d.ts.map +1 -0
  52. package/dist/recommend/index.js +412 -0
  53. package/dist/recommend/index.js.map +1 -0
  54. package/dist/tools/generate-code.d.ts +18 -0
  55. package/dist/tools/generate-code.d.ts.map +1 -0
  56. package/dist/tools/generate-code.js +155 -0
  57. package/dist/tools/generate-code.js.map +1 -0
  58. package/dist/tools/get-api-info.d.ts +18 -0
  59. package/dist/tools/get-api-info.d.ts.map +1 -0
  60. package/dist/tools/get-api-info.js +65 -0
  61. package/dist/tools/get-api-info.js.map +1 -0
  62. package/dist/tools/get-coding-standard.d.ts +18 -0
  63. package/dist/tools/get-coding-standard.d.ts.map +1 -0
  64. package/dist/tools/get-coding-standard.js +66 -0
  65. package/dist/tools/get-coding-standard.js.map +1 -0
  66. package/dist/tools/get-component-info.d.ts +18 -0
  67. package/dist/tools/get-component-info.d.ts.map +1 -0
  68. package/dist/tools/get-component-info.js +60 -0
  69. package/dist/tools/get-component-info.js.map +1 -0
  70. package/dist/tools/get-util-info.d.ts +18 -0
  71. package/dist/tools/get-util-info.d.ts.map +1 -0
  72. package/dist/tools/get-util-info.js +65 -0
  73. package/dist/tools/get-util-info.js.map +1 -0
  74. package/dist/tools/index.d.ts +56 -0
  75. package/dist/tools/index.d.ts.map +1 -0
  76. package/dist/tools/index.js +101 -0
  77. package/dist/tools/index.js.map +1 -0
  78. package/dist/tools/recommend-solution.d.ts +18 -0
  79. package/dist/tools/recommend-solution.d.ts.map +1 -0
  80. package/dist/tools/recommend-solution.js +67 -0
  81. package/dist/tools/recommend-solution.js.map +1 -0
  82. package/dist/tools/search-docs.d.ts +18 -0
  83. package/dist/tools/search-docs.d.ts.map +1 -0
  84. package/dist/tools/search-docs.js +71 -0
  85. package/dist/tools/search-docs.js.map +1 -0
  86. package/dist/types/index.d.ts +285 -0
  87. package/dist/types/index.d.ts.map +1 -0
  88. package/dist/types/index.js +8 -0
  89. package/dist/types/index.js.map +1 -0
  90. package/package.json +27 -26
  91. package/resources/cases/.gitkeep +0 -0
  92. package/resources/cases/form-submit-vue2.json +15 -0
  93. package/resources/cases/index.json +8 -0
  94. package/resources/cases/list-detail-vue2.json +27 -0
  95. package/resources/components/.gitkeep +0 -0
  96. package/resources/components/button.json +74 -0
  97. package/resources/components/cell.json +69 -0
  98. package/resources/components/field.json +88 -0
  99. package/resources/components/index.json +72 -0
  100. package/resources/standards/.gitkeep +0 -0
  101. package/resources/standards/css.json +108 -0
  102. package/resources/standards/javascript.json +129 -0
  103. package/resources/standards/project-structure.json +101 -0
  104. package/resources/standards/vue.json +122 -0
  105. package/resources/utils/.gitkeep +0 -0
  106. package/resources/utils/ajax.json +76 -0
  107. package/resources/utils/common.json +129 -0
  108. package/resources/utils/index.json +7 -0
  109. package/resources/utils/string.json +112 -0
  110. package/bin/m8-mcp.js +0 -2
  111. package/dist/constants.js +0 -1
  112. package/dist/data/ejs-doc/api_audio/api_audio.md +0 -225
  113. package/dist/data/ejs-doc/api_auth/api_auth.md +0 -256
  114. package/dist/data/ejs-doc/api_contact/api_contact.md +0 -295
  115. package/dist/data/ejs-doc/api_contact/images/component_contact.jpg +0 -0
  116. package/dist/data/ejs-doc/api_device/api_device.md +0 -761
  117. package/dist/data/ejs-doc/api_event/api_event.md +0 -244
  118. package/dist/data/ejs-doc/api_global/api_global.md +0 -440
  119. package/dist/data/ejs-doc/api_io/api_io.md +0 -369
  120. package/dist/data/ejs-doc/api_navigator/api_navigator.md +0 -654
  121. package/dist/data/ejs-doc/api_navigator/images/navigator.backbtn.png +0 -0
  122. package/dist/data/ejs-doc/api_navigator/images/navigator.hide.png +0 -0
  123. package/dist/data/ejs-doc/api_navigator/images/navigator.hidestatus.png +0 -0
  124. package/dist/data/ejs-doc/api_navigator/images/navigator.leftarrowbtn.jpg +0 -0
  125. package/dist/data/ejs-doc/api_navigator/images/navigator.leftbtn.png +0 -0
  126. package/dist/data/ejs-doc/api_navigator/images/navigator.leftbtnimg.png +0 -0
  127. package/dist/data/ejs-doc/api_navigator/images/navigator.multititle.jpg +0 -0
  128. package/dist/data/ejs-doc/api_navigator/images/navigator.rightbtn.png +0 -0
  129. package/dist/data/ejs-doc/api_navigator/images/navigator.rightbtn2.png +0 -0
  130. package/dist/data/ejs-doc/api_navigator/images/navigator.rightbtnimg.png +0 -0
  131. package/dist/data/ejs-doc/api_navigator/images/navigator.rightbtnimg2.png +0 -0
  132. package/dist/data/ejs-doc/api_navigator/images/navigator.rightmenu.png +0 -0
  133. package/dist/data/ejs-doc/api_navigator/images/navigator.searchbar.png +0 -0
  134. package/dist/data/ejs-doc/api_navigator/images/navigator.subtitle.jpg +0 -0
  135. package/dist/data/ejs-doc/api_navigator/images/navigator.title.png +0 -0
  136. package/dist/data/ejs-doc/api_page/api_page.md +0 -261
  137. package/dist/data/ejs-doc/api_runtime/api_runtime.md +0 -788
  138. package/dist/data/ejs-doc/api_storage/api_storage.md +0 -320
  139. package/dist/data/ejs-doc/api_stream/api_stream.md +0 -152
  140. package/dist/data/ejs-doc/api_stream/images/body_multiform.jpg +0 -0
  141. package/dist/data/ejs-doc/api_ui/api_ui.md +0 -836
  142. package/dist/data/ejs-doc/api_ui/images/ui.popwindow.png +0 -0
  143. package/dist/data/ejs-doc/api_ui/images/ui_actionsheet.png +0 -0
  144. package/dist/data/ejs-doc/api_ui/images/ui_alert.png +0 -0
  145. package/dist/data/ejs-doc/api_ui/images/ui_confirm.png +0 -0
  146. package/dist/data/ejs-doc/api_ui/images/ui_pickDateTime.png +0 -0
  147. package/dist/data/ejs-doc/api_ui/images/ui_pickdate.png +0 -0
  148. package/dist/data/ejs-doc/api_ui/images/ui_pickmonth.png +0 -0
  149. package/dist/data/ejs-doc/api_ui/images/ui_picktime.png +0 -0
  150. package/dist/data/ejs-doc/api_ui/images/ui_poppicker.png +0 -0
  151. package/dist/data/ejs-doc/api_ui/images/ui_poppicker2.png +0 -0
  152. package/dist/data/ejs-doc/api_ui/images/ui_poppicker3.png +0 -0
  153. package/dist/data/ejs-doc/api_ui/images/ui_prompt.png +0 -0
  154. package/dist/data/ejs-doc/api_ui/images/ui_select.png +0 -0
  155. package/dist/data/ejs-doc/api_ui/images/ui_select2.png +0 -0
  156. package/dist/data/ejs-doc/api_ui/images/ui_select3.png +0 -0
  157. package/dist/data/ejs-doc/api_ui/images/ui_showdebugdialog.png +0 -0
  158. package/dist/data/ejs-doc/api_ui/images/ui_showwaiting.png +0 -0
  159. package/dist/data/ejs-doc/api_ui/images/ui_toast.png +0 -0
  160. package/dist/data/ejs-doc/api_ui/images/ui_toastAndEvent.png +0 -0
  161. package/dist/data/ejs-doc/api_util/api_util.md +0 -615
  162. package/dist/data/ejs-doc/api_util/images/util.playvideo.png +0 -0
  163. package/dist/data/ejs-doc/api_util/images/util.previmage.png +0 -0
  164. package/dist/data/ejs-doc/api_util/images/util.selectfile.png +0 -0
  165. package/dist/data/ejs-doc/api_util/images/util.selectimage.png +0 -0
  166. package/dist/data/m8mpdoc-develop/003-/345/205/270/345/236/213/346/241/210/344/276/213/003-/345/210/227/350/241/250/350/257/246/346/203/205.md +0 -247
  167. package/dist/data/m8mpdoc-develop/003-/345/205/270/345/236/213/346/241/210/344/276/213/003-/345/210/227/350/241/250/350/257/246/346/203/205vue3.md +0 -276
  168. package/dist/data/m8mpdoc-develop/003-/345/205/270/345/236/213/346/241/210/344/276/213/003-/350/241/250/345/215/225/346/217/220/344/272/244.md +0 -130
  169. package/dist/data/m8mpdoc-develop/003-/345/205/270/345/236/213/346/241/210/344/276/213/003-/350/241/250/345/215/225/346/217/220/344/272/244vue3.md +0 -115
  170. package/dist/data/m8mpdoc-develop/005-/346/240/270/345/277/203/351/200/232/347/224/250Util/000-/346/240/270/345/277/203/346/226/271/346/263/225.md +0 -398
  171. package/dist/data/m8mpdoc-develop/005-/346/240/270/345/277/203/351/200/232/347/224/250Util/001-Ajax/344/270/216/346/226/207/344/273/266/344/270/212/344/274/240.md +0 -456
  172. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/000-charset.md +0 -128
  173. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/001-base64.md +0 -142
  174. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/002-date.md +0 -210
  175. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/004-math.md +0 -85
  176. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/006-sha1.md +0 -21
  177. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/007-sha256.md +0 -36
  178. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/008-storage.md +0 -128
  179. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/009-string.md +0 -148
  180. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/010-Util/346/211/251/345/261/225/346/214/207/345/215/227.md +0 -76
  181. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/011-cookie.md +0 -59
  182. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/012-util-sm.md +0 -95
  183. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-1.baseapi.md +0 -76
  184. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-2.network.md +0 -202
  185. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-2.socketTask.md +0 -92
  186. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-3.uiapi.md +0 -412
  187. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-4.eventapi.md +0 -146
  188. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/013-5.otherapi.md +0 -137
  189. package/dist/data/m8mpdoc-develop/006-Util/345/267/245/345/205/267/351/233/206/014-util-mpVerifyManager.md +0 -363
  190. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/000-/347/273/204/344/273/266/345/272/223/344/270/213/350/275/275/344/275/277/347/224/250.md +0 -188
  191. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/001-actionsheet/345/212/250/344/275/234/351/235/242/346/235/277.md +0 -460
  192. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/004-amap/345/234/260/345/233/276.md +0 -285
  193. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/005-button/346/214/211/351/222/256.md +0 -211
  194. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/008-cell/345/215/225/345/205/203/346/240/274.md +0 -213
  195. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/009-checkbox/345/244/215/351/200/211/346/241/206.md +0 -501
  196. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/010-circle/347/216/257/345/275/242/350/277/233/345/272/246/346/235/241.md +0 -168
  197. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/011-datepicker/346/227/245/346/234/237/351/200/211/346/213/251.md +0 -617
  198. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/013-field/350/276/223/345/205/245/346/241/206.md +0 -539
  199. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/015-form/350/241/250/345/215/225.md +0 -999
  200. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/018-header/345/244/264/351/203/250/345/257/274/350/210/252/346/240/217.md +0 -150
  201. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/019-icon/345/233/276/346/240/207.md +0 -133
  202. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/020-loading/345/212/240/350/275/275.md +0 -117
  203. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/021-noticebar/351/200/232/347/237/245/346/240/217.md +0 -152
  204. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/022-numberkeyboard/346/225/260/345/255/227/351/224/256/347/233/230.md +0 -427
  205. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/023-pagination/345/210/206/351/241/265.md +0 -212
  206. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/024-panel/351/235/242/346/235/277.md +0 -85
  207. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/025-passwordinput/345/257/206/347/240/201/350/276/223/345/205/245/346/241/206.md +0 -175
  208. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/026-picker/351/200/211/346/213/251/345/231/250.md +0 -519
  209. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/027-popup/345/274/271/345/207/272/345/261/202.md +0 -152
  210. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/028-progress/350/277/233/345/272/246/346/235/241.md +0 -103
  211. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/029-radio/345/215/225/351/200/211/346/241/206.md +0 -285
  212. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/030-rate/350/257/204/345/210/206.md +0 -189
  213. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/031-search/346/220/234/347/264/242.md +0 -217
  214. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/032-slider/346/273/221/345/235/227.md +0 -166
  215. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/033-stepper/346/255/245/350/277/233/345/231/250.md +0 -340
  216. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/035-swipecell/346/273/221/345/212/250/345/215/225/345/205/203/346/240/274.md +0 -265
  217. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/036-switch/345/274/200/345/205/263.md +0 -196
  218. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/037-switchcell/345/274/200/345/205/263/345/215/225/345/205/203/346/240/274.md +0 -115
  219. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/038-tag/346/240/207/350/256/260.md +0 -232
  220. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/039-treeselect/345/210/206/347/261/273/351/200/211/346/213/251.md +0 -631
  221. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/040-uploader/346/226/207/344/273/266/344/270/212/344/274/240.md +0 -531
  222. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/041-verifycode/351/252/214/350/257/201/347/240/201.md +0 -111
  223. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/042-minirefresh/344/270/213/346/213/211/345/210/267/346/226/260.md +0 -337
  224. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/043-layout/345/270/203/345/261/200.md +0 -150
  225. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/044-image/345/233/276/347/211/207.md +0 -144
  226. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/045-toast/350/275/273/346/217/220/347/244/272.md +0 -429
  227. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/046-calendar/346/227/245/345/216/206.md +0 -467
  228. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/047-area/347/234/201/345/270/202/345/214/272/351/200/211/346/213/251.md +0 -295
  229. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/048-tab/346/240/207/347/255/276/351/241/265.md +0 -577
  230. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/049-dialog/345/274/271/345/207/272/346/241/206.md +0 -491
  231. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/050-dropdownmenu/344/270/213/346/213/211/350/217/234/345/215/225.md +0 -265
  232. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/051-notify/346/266/210/346/201/257/351/200/232/347/237/245.md +0 -203
  233. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/052-overlay/351/201/256/347/275/251/345/261/202.md +0 -139
  234. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/053-collapse/346/212/230/345/217/240/351/235/242/346/235/277.md +0 -199
  235. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/054-grid/345/256/253/346/240/274.md +0 -183
  236. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/055-countdown/345/200/222/350/256/241/346/227/266.md +0 -289
  237. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/056-divider/345/210/206/345/211/262/347/272/277.md +0 -97
  238. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/057-empty/347/251/272/347/212/266/346/200/201.md +0 -146
  239. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/058-imagepreview/345/233/276/347/211/207/351/242/204/350/247/210.md +0 -292
  240. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/059-lazyload/346/207/222/345/212/240/350/275/275.md +0 -120
  241. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/060-skeleton/351/252/250/346/236/266/345/261/217.md +0 -114
  242. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/061-steps/346/255/245/351/252/244/346/235/241.md +0 -119
  243. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/062-sticky/347/262/230/346/200/247/345/270/203/345/261/200.md +0 -208
  244. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/063-indexbar/347/264/242/345/274/225/346/240/217.md +0 -161
  245. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/064-sidebar/344/276/247/350/276/271/345/257/274/350/210/252.md +0 -248
  246. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/065-tabbar/346/240/207/347/255/276/346/240/217.md +0 -314
  247. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/066-badge/345/276/275/346/240/207.md +0 -162
  248. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/067-popover/346/260/224/346/263/241/345/274/271/345/207/272/346/241/206.md +0 -325
  249. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/068-cascader/347/272/247/350/201/224/351/200/211/346/213/251.md +0 -360
  250. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/069-selectperson/351/200/211/344/272/272/347/273/204/344/273/266.md +0 -595
  251. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/070-swipe/350/275/256/346/222/255.md +0 -262
  252. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/071-/345/233/275/351/231/205/345/214/226.md +0 -51
  253. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/072-easycalendar/346/227/245/345/216/206.md +0 -132
  254. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/073-qrcode/344/272/214/347/273/264/347/240/201.md +0 -1538
  255. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/074-imagescale/345/233/276/347/211/207/350/243/201/345/211/252.md +0 -261
  256. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/075-dragsort/346/213/226/346/213/275/346/216/222/345/272/217.md +0 -161
  257. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/076-chart/345/233/276/350/241/250.md +0 -381
  258. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/077-rtc/351/237/263/350/247/206/351/242/221.md +0 -531
  259. package/dist/data/m8mpdoc-develop/009-UI/347/273/204/344/273/266/078-table/350/241/250/346/240/274.md +0 -849
  260. package/dist/data/m8mpdoc-develop/012-Mock/347/232/204/344/275/277/347/224/250/Mock/347/232/204/344/275/277/347/224/250.md +0 -116
  261. package/dist/data/standards/css-style.md +0 -531
  262. package/dist/data/standards/js-style.md +0 -394
  263. package/dist/data/standards/project-structure.md +0 -325
  264. package/dist/data/standards/vue-style.md +0 -644
  265. package/dist/tools/search.js +0 -1
  266. package/dist/tools/standards.js +0 -1
@@ -0,0 +1,129 @@
1
+ {
2
+ "id": "js-style",
3
+ "category": "javascript",
4
+ "title": "JavaScript/TypeScript 编码规范",
5
+ "version": "1.0.0",
6
+ "lastUpdated": "2024-12-19",
7
+ "description": "M8 框架项目中 JavaScript/TypeScript 的编码标准",
8
+ "rules": [
9
+ {
10
+ "id": "js-camelcase",
11
+ "title": "变量和函数使用 camelCase",
12
+ "description": "变量名和函数名应该使用小驼峰命名法。",
13
+ "correctExample": "const userName = 'John';\nconst itemCount = 10;\nfunction getUserInfo() { }\nfunction handleClick() { }",
14
+ "incorrectExample": "const user_name = 'John';\nconst ItemCount = 10;\nfunction GetUserInfo() { }"
15
+ },
16
+ {
17
+ "id": "js-constants",
18
+ "title": "常量使用 UPPER_SNAKE_CASE",
19
+ "description": "常量应该使用全大写加下划线的命名方式。",
20
+ "correctExample": "const MAX_COUNT = 100;\nconst API_BASE_URL = '/api';\nconst DEFAULT_PAGE_SIZE = 20;",
21
+ "incorrectExample": "const maxCount = 100;\nconst apiBaseUrl = '/api';"
22
+ },
23
+ {
24
+ "id": "js-class-pascalcase",
25
+ "title": "类和组件使用 PascalCase",
26
+ "description": "类名和组件名应该使用大驼峰命名法。",
27
+ "correctExample": "class UserService { }\nclass DataManager { }\nconst UserProfile = defineComponent({ });",
28
+ "incorrectExample": "class userService { }\nclass data_manager { }"
29
+ },
30
+ {
31
+ "id": "js-single-responsibility",
32
+ "title": "函数应该只做一件事",
33
+ "description": "每个函数应该只负责一个功能,保持函数的单一职责。",
34
+ "correctExample": "function validateEmail(email) {\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n}\n\nfunction formatUserName(user) {\n return `${user.firstName} ${user.lastName}`;\n}",
35
+ "incorrectExample": "function processUser(user) {\n // 验证、格式化、保存、发送通知都在一个函数里\n}"
36
+ },
37
+ {
38
+ "id": "js-default-params",
39
+ "title": "使用默认参数",
40
+ "description": "使用 ES6 默认参数语法代替手动检查和赋值。",
41
+ "correctExample": "function createUser(name, role = 'user', active = true) {\n return { name, role, active };\n}",
42
+ "incorrectExample": "function createUser(name, role, active) {\n role = role || 'user';\n active = active !== undefined ? active : true;\n}"
43
+ },
44
+ {
45
+ "id": "js-destructuring",
46
+ "title": "使用解构参数",
47
+ "description": "当函数参数较多时,使用对象解构使代码更清晰。",
48
+ "correctExample": "function updateUser({ id, name, email }) {\n // ...\n}\n\nupdateUser({ id: 1, name: 'John', email: 'john@example.com' });",
49
+ "incorrectExample": "function updateUser(id, name, email) {\n // ...\n}"
50
+ },
51
+ {
52
+ "id": "js-async-await",
53
+ "title": "优先使用 async/await",
54
+ "description": "异步操作优先使用 async/await 语法,避免回调地狱。",
55
+ "correctExample": "async function fetchUserData(userId) {\n try {\n const response = await Util.ajax({\n url: `${Config.serverUrl}/api/user/${userId}`,\n type: 'GET'\n });\n return response.data;\n } catch (error) {\n console.error('获取用户数据失败:', error);\n throw error;\n }\n}",
56
+ "incorrectExample": "function fetchUserData(userId, callback) {\n Util.ajax({\n url: url,\n success: (response) => {\n Util.ajax({\n // 嵌套回调...\n });\n }\n });\n}"
57
+ },
58
+ {
59
+ "id": "js-promise-all",
60
+ "title": "并发请求使用 Promise.all",
61
+ "description": "多个独立的异步请求应该使用 Promise.all 并发执行。",
62
+ "correctExample": "async function loadPageData() {\n const [users, products, orders] = await Promise.all([\n fetchUsers(),\n fetchProducts(),\n fetchOrders()\n ]);\n return { users, products, orders };\n}",
63
+ "incorrectExample": "async function loadPageData() {\n const users = await fetchUsers();\n const products = await fetchProducts();\n const orders = await fetchOrders();\n}"
64
+ },
65
+ {
66
+ "id": "js-try-catch",
67
+ "title": "使用 try-catch 处理异步错误",
68
+ "description": "异步操作必须使用 try-catch 进行错误处理。",
69
+ "correctExample": "async function submitForm(data) {\n try {\n const result = await Util.ajax({\n url: Config.serverUrl + '/api/submit',\n type: 'POST',\n data: { params: JSON.stringify(data) }\n });\n return result.data;\n } catch (error) {\n console.error('表单提交失败:', error);\n ejs.ui.toast({ message: error.message || '网络错误,请重试' });\n throw error;\n }\n}",
70
+ "incorrectExample": "async function submitForm(data) {\n const result = await Util.ajax({ ... });\n return result.data;\n}"
71
+ },
72
+ {
73
+ "id": "js-meaningful-errors",
74
+ "title": "提供有意义的错误信息",
75
+ "description": "抛出的错误应该包含有意义的描述信息。",
76
+ "correctExample": "function validateAge(age) {\n if (typeof age !== 'number') {\n throw new TypeError(`年龄必须是数字,收到: ${typeof age}`);\n }\n if (age < 0 || age > 150) {\n throw new RangeError(`年龄必须在 0-150 之间,收到: ${age}`);\n }\n}",
77
+ "incorrectExample": "function validateAge(age) {\n if (typeof age !== 'number' || age < 0 || age > 150) {\n throw new Error('Invalid');\n }\n}"
78
+ },
79
+ {
80
+ "id": "js-util-ajax",
81
+ "title": "使用 Util.ajax 进行 HTTP 请求",
82
+ "description": "M8 框架中必须使用 Util.ajax 进行网络请求,禁止使用 fetch 或 axios。",
83
+ "correctExample": "const result = await Util.ajax({\n url: Config.serverUrl + '/api/data',\n type: 'POST',\n data: { params: JSON.stringify(params) },\n dataPath: 'data'\n});",
84
+ "incorrectExample": "const result = await fetch('/api/data');\nconst result = await axios.get('/api/data');"
85
+ },
86
+ {
87
+ "id": "js-config-url",
88
+ "title": "使用 Config 管理配置",
89
+ "description": "API 地址等配置必须使用 Config 对象,禁止硬编码。",
90
+ "correctExample": "const apiUrl = Config.serverUrl + '/api/users';",
91
+ "incorrectExample": "const apiUrl = 'http://localhost:3000/api/users';"
92
+ },
93
+ {
94
+ "id": "js-no-var",
95
+ "title": "避免使用 var",
96
+ "description": "使用 const 和 let 代替 var。",
97
+ "correctExample": "const name = 'John'; // 不会重新赋值\nlet count = 0; // 会重新赋值",
98
+ "incorrectExample": "var count = 0;\nvar name = 'John';"
99
+ },
100
+ {
101
+ "id": "js-no-mutate-params",
102
+ "title": "避免修改函数参数",
103
+ "description": "不要直接修改函数参数,应该返回新对象。",
104
+ "correctExample": "function updateUser(user) {\n return {\n ...user,\n name: 'New Name'\n };\n}",
105
+ "incorrectExample": "function updateUser(user) {\n user.name = 'New Name';\n return user;\n}"
106
+ },
107
+ {
108
+ "id": "js-strict-equality",
109
+ "title": "避免使用 == 进行比较",
110
+ "description": "使用严格相等 === 代替宽松相等 ==。",
111
+ "correctExample": "if (count === 0) { }",
112
+ "incorrectExample": "if (value == null) { }\nif (count == '0') { }"
113
+ },
114
+ {
115
+ "id": "js-util-string",
116
+ "title": "使用 Util.string 进行字符串校验",
117
+ "description": "优先使用 Util.string 提供的校验方法,而不是手写正则。",
118
+ "correctExample": "Util.string.isMobile('13800000000');\nUtil.string.isEmail('test@example.com');\nUtil.string.isIdCard('110101199001011234');",
119
+ "incorrectExample": "/^1[3-9]\\d{9}$/.test('13800000000');"
120
+ },
121
+ {
122
+ "id": "js-console-log",
123
+ "title": "日志输出规范",
124
+ "description": "禁止使用无参数的 console.log,必须包含日志信息描述。",
125
+ "correctExample": "console.log('提交表单数据:', data);\nconsole.error('接口请求失败:', err);",
126
+ "incorrectExample": "console.log(data);"
127
+ }
128
+ ]
129
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "id": "project-structure",
3
+ "category": "project-structure",
4
+ "title": "项目结构规范",
5
+ "version": "1.0.0",
6
+ "lastUpdated": "2024-12-19",
7
+ "description": "M8 框架项目的目录结构和文件组织标准",
8
+ "rules": [
9
+ {
10
+ "id": "project-standard-structure",
11
+ "title": "标准项目结构",
12
+ "description": "M8 项目应该遵循标准的目录结构,包括 src/api、src/assets、src/components、src/pages、src/router、src/store、src/utils 等目录。",
13
+ "correctExample": "project/\n├── src/\n│ ├── api/ # API 接口定义\n│ ├── assets/ # 静态资源\n│ ├── components/ # 公共组件\n│ ├── pages/ # 页面组件\n│ ├── router/ # 路由配置\n│ ├── store/ # 状态管理\n│ ├── utils/ # 工具函数\n│ ├── App.vue\n│ └── main.js",
14
+ "incorrectExample": "project/\n├── src/\n│ ├── all-files-in-one-folder/"
15
+ },
16
+ {
17
+ "id": "project-component-naming",
18
+ "title": "组件文件命名使用 PascalCase",
19
+ "description": "组件文件使用 PascalCase 命名。",
20
+ "correctExample": "components/\n├── UserProfile.vue\n├── TodoList.vue\n└── common/\n ├── BaseButton.vue\n └── BaseInput.vue",
21
+ "incorrectExample": "components/\n├── userProfile.vue\n├── todo-list.vue"
22
+ },
23
+ {
24
+ "id": "project-page-structure",
25
+ "title": "页面文件按模块划分",
26
+ "description": "页面文件应严格按照模块划分,每个模块对应一个文件夹。",
27
+ "correctExample": "pages/\n├── home/\n│ └── index.vue\n├── user/\n│ ├── index.vue\n│ ├── profile.vue\n│ └── settings.vue\n└── order/\n ├── list.vue\n └── detail.vue",
28
+ "incorrectExample": "pages/\n├── home.vue\n├── user.vue\n├── user-profile.vue"
29
+ },
30
+ {
31
+ "id": "project-utils-naming",
32
+ "title": "工具函数文件使用 kebab-case",
33
+ "description": "工具函数文件使用 kebab-case 命名。",
34
+ "correctExample": "utils/\n├── date-format.js\n├── string-utils.js\n├── validate.js\n└── index.js",
35
+ "incorrectExample": "utils/\n├── dateFormat.js\n├── StringUtils.js"
36
+ },
37
+ {
38
+ "id": "project-api-organization",
39
+ "title": "按模块组织 API",
40
+ "description": "API 接口应该按模块组织,并在 index.js 中统一导出。",
41
+ "correctExample": "// api/user.js\nexport function getUserInfo(userId) {\n return request({\n url: `/api/user/${userId}`,\n method: 'GET'\n });\n}\n\n// api/index.js\nexport * from './user';\nexport * from './order';",
42
+ "incorrectExample": "// 所有 API 都写在一个文件里"
43
+ },
44
+ {
45
+ "id": "project-request-wrapper",
46
+ "title": "请求封装",
47
+ "description": "应该封装统一的请求方法,使用 Util.ajax 和 Config.serverUrl。",
48
+ "correctExample": "// api/request.js\nexport function request(options) {\n return Util.ajax({\n url: Config.serverUrl + options.url,\n type: options.method || 'POST',\n data: options.data ? { params: JSON.stringify(options.data) } : undefined\n });\n}",
49
+ "incorrectExample": "// 每个 API 都直接调用 fetch 或 axios"
50
+ },
51
+ {
52
+ "id": "project-common-components",
53
+ "title": "公共组件使用 Base 或 Ne 前缀",
54
+ "description": "公共组件放在 components/common/ 目录下,使用 Base 或 Ne 前缀。",
55
+ "correctExample": "components/\n├── common/\n│ ├── BaseButton.vue\n│ ├── BaseInput.vue\n│ └── index.js\n└── business/\n ├── UserCard.vue\n └── OrderItem.vue",
56
+ "incorrectExample": "components/\n├── Button.vue\n├── Input.vue"
57
+ },
58
+ {
59
+ "id": "project-page-components",
60
+ "title": "页面级组件放在页面目录下",
61
+ "description": "页面特有的组件放在页面目录下的 components/ 子目录中。",
62
+ "correctExample": "pages/\n└── order/\n ├── index.vue\n ├── detail.vue\n └── components/\n ├── OrderHeader.vue\n └── OrderItems.vue",
63
+ "incorrectExample": "// 页面特有组件放在全局 components 目录"
64
+ },
65
+ {
66
+ "id": "project-vuex-modules",
67
+ "title": "Vuex 模块化 (M8.3)",
68
+ "description": "Vuex 状态管理应该按模块划分。",
69
+ "correctExample": "store/\n├── index.js\n└── modules/\n ├── user.js\n ├── cart.js\n └── order.js",
70
+ "incorrectExample": "store/\n└── index.js // 所有状态都在一个文件里"
71
+ },
72
+ {
73
+ "id": "project-pinia-modules",
74
+ "title": "Pinia 模块化 (M8.4)",
75
+ "description": "Pinia 状态管理应该按模块划分,使用 useXxxStore 命名。",
76
+ "correctExample": "store/\n├── index.js\n└── modules/\n ├── useUserStore.js\n ├── useCartStore.js\n └── useOrderStore.js",
77
+ "incorrectExample": "store/\n└── index.js // 所有状态都在一个文件里"
78
+ },
79
+ {
80
+ "id": "project-styles-organization",
81
+ "title": "全局样式组织",
82
+ "description": "全局样式应该放在 assets/styles/ 目录下统一管理。",
83
+ "correctExample": "assets/\n└── styles/\n ├── index.scss\n ├── variables.scss\n ├── mixins.scss\n ├── reset.scss\n └── utils.scss",
84
+ "incorrectExample": "// 样式文件散落在各处"
85
+ },
86
+ {
87
+ "id": "project-no-deep-nesting",
88
+ "title": "避免过深的目录嵌套",
89
+ "description": "目录结构应该保持扁平化,避免过深的嵌套。",
90
+ "correctExample": "src/pages/user/profile.vue\nsrc/components/UserAvatar.vue",
91
+ "incorrectExample": "src/modules/user/pages/profile/components/header/UserAvatar.vue"
92
+ },
93
+ {
94
+ "id": "project-no-circular-deps",
95
+ "title": "避免循环依赖",
96
+ "description": "模块之间不应该存在循环依赖,应该提取公共依赖。",
97
+ "correctExample": "// constants.js\nexport const BASE = 1;\n\n// a.js\nimport { BASE } from './constants';\nexport const a = BASE + 1;\n\n// b.js\nimport { BASE } from './constants';\nexport const b = BASE + 2;",
98
+ "incorrectExample": "// a.js\nimport { b } from './b';\nexport const a = b + 1;\n\n// b.js\nimport { a } from './a';\nexport const b = a + 1;"
99
+ }
100
+ ]
101
+ }
@@ -0,0 +1,122 @@
1
+ {
2
+ "id": "vue-style",
3
+ "category": "vue",
4
+ "title": "Vue 组件编码规范",
5
+ "version": "1.2.0",
6
+ "lastUpdated": "2024-12-22",
7
+ "description": "M8 框架 Vue 组件的编码标准,适用于 M8.3 (Vue2) 和 M8.4 (Vue3) 项目",
8
+ "rules": [
9
+ {
10
+ "id": "vue-file-header",
11
+ "title": ".vue 文件必须包含头部注释",
12
+ "description": "每个 .vue 文件必须在顶部添加标准化的注释块,包含作者、时间、版本、版权和描述信息。",
13
+ "correctExample": "<!--\n * @作者: 张三\n * @创建时间: 2024-11-11 14:20:03\n * @修改时间: 2024-11-11 14:20:03\n * @版本: [1.0]\n * @版权: 国泰新点软件股份有限公司\n * @描述: 用户信息展示组件\n-->\n<template>\n <!-- 组件内容 -->\n</template>",
14
+ "incorrectExample": "<template>\n <!-- 缺少头部注释 -->\n</template>"
15
+ },
16
+ {
17
+ "id": "vue-component-naming",
18
+ "title": "组件文件命名使用 PascalCase",
19
+ "description": "组件文件名应使用 PascalCase 命名法。",
20
+ "correctExample": "UserProfile.vue\nTodoList.vue\nSearchInput.vue",
21
+ "incorrectExample": "userProfile.vue\nuser-profile.vue\ntodolist.vue"
22
+ },
23
+ {
24
+ "id": "vue-base-component-prefix",
25
+ "title": "基础组件使用特定前缀",
26
+ "description": "应用特定样式和约定的基础组件应该全部以一个特定的前缀开头,比如 Base、App 或 Ne。",
27
+ "correctExample": "BaseButton.vue\nBaseTable.vue\nNeInput.vue",
28
+ "incorrectExample": "MyButton.vue\nVueTable.vue"
29
+ },
30
+ {
31
+ "id": "vue-props-type",
32
+ "title": "Props 必须指定类型",
33
+ "description": "Props 定义应该尽量详细,至少需要指定其类型。",
34
+ "correctExample": "// Vue2\nexport default {\n props: {\n status: {\n type: String,\n required: true\n },\n count: {\n type: Number,\n default: 0\n }\n }\n}\n\n// Vue3\nconst props = defineProps<{\n status: 'success' | 'warning' | 'error';\n count?: number;\n}>();",
35
+ "incorrectExample": "props: ['status', 'count']"
36
+ },
37
+ {
38
+ "id": "vue-props-camelcase",
39
+ "title": "Props 命名使用 camelCase",
40
+ "description": "在声明 props 时,其命名应该始终使用 camelCase。",
41
+ "correctExample": "props: {\n greetingText: String\n}",
42
+ "incorrectExample": "props: {\n 'greeting-text': String\n}"
43
+ },
44
+ {
45
+ "id": "vue-event-kebabcase",
46
+ "title": "事件名使用 kebab-case",
47
+ "description": "事件名应该使用 kebab-case 命名。",
48
+ "correctExample": "this.$emit('item-click', item);\nemit('update-value', newValue);",
49
+ "incorrectExample": "this.$emit('itemClick', item);\nemit('updateValue', newValue);"
50
+ },
51
+ {
52
+ "id": "vue-self-closing",
53
+ "title": "组件标签自闭合",
54
+ "description": "没有内容的组件应该自闭合。",
55
+ "correctExample": "<MyComponent />\n<ne-button type=\"primary\" />",
56
+ "incorrectExample": "<MyComponent></MyComponent>\n<ne-button type=\"primary\"></ne-button>"
57
+ },
58
+ {
59
+ "id": "vue-multi-attribute",
60
+ "title": "多属性换行",
61
+ "description": "当组件有多个属性时,应该每个属性占一行。",
62
+ "correctExample": "<ne-field\n v-model=\"formData.name\"\n label=\"姓名\"\n placeholder=\"请输入姓名\"\n required\n :rules=\"nameRules\"\n/>",
63
+ "incorrectExample": "<ne-field v-model=\"formData.name\" label=\"姓名\" placeholder=\"请输入姓名\" required :rules=\"nameRules\" />"
64
+ },
65
+ {
66
+ "id": "vue-script-setup",
67
+ "title": "使用 script setup (Vue3)",
68
+ "description": "Vue3 项目推荐使用 <script setup> 语法。",
69
+ "correctExample": "<script setup>\nimport { ref, computed } from 'vue';\n\nconst count = ref(0);\nconst double = computed(() => count.value * 2);\n</script>",
70
+ "incorrectExample": "<script>\nimport { ref, computed, defineComponent } from 'vue';\n\nexport default defineComponent({\n setup() {\n const count = ref(0);\n return { count };\n }\n});\n</script>"
71
+ },
72
+ {
73
+ "id": "vue-code-order",
74
+ "title": "响应式数据声明顺序",
75
+ "description": "按照以下顺序组织代码:props/emits → refs → computed → watch → 生命周期 → methods",
76
+ "correctExample": "<script setup>\n// 1. Props 和 Emits\nconst props = defineProps<{ title: string }>();\nconst emit = defineEmits<{ (e: 'update', value: string): void }>();\n\n// 2. 响应式数据\nconst count = ref(0);\n\n// 3. 计算属性\nconst total = computed(() => count.value);\n\n// 4. 侦听器\nwatch(count, (newVal) => { });\n\n// 5. 生命周期\nonMounted(() => { });\n\n// 6. 方法\nfunction loadData() { }\n</script>",
77
+ "incorrectExample": "// 代码顺序混乱"
78
+ },
79
+ {
80
+ "id": "vue-style-external",
81
+ "title": "样式必须剥离到外部文件",
82
+ "description": "Vue 组件的样式必须剥离到独立的 SCSS 文件中,通过 @import 方式引入。",
83
+ "correctExample": "<style lang=\"scss\" scoped>\n@import './css/login.scss';\n</style>",
84
+ "incorrectExample": "<style lang=\"scss\" scoped>\n.login_page {\n // 大量样式代码直接写在 .vue 文件中\n}\n</style>"
85
+ },
86
+ {
87
+ "id": "vue-style-scoped",
88
+ "title": "style 标签必须使用 scoped",
89
+ "description": "为避免样式污染,<style> 标签必须添加 scoped 属性。",
90
+ "correctExample": "<style lang=\"scss\" scoped>\n@import './css/user-profile.scss';\n</style>",
91
+ "incorrectExample": "<style lang=\"scss\">\n@import './css/user-profile.scss';\n</style>"
92
+ },
93
+ {
94
+ "id": "vue-no-header-refactor",
95
+ "title": "重构页面时不添加导航栏",
96
+ "description": "重构现有页面时,不需要添加 em-header 或 nav-bar 导航栏组件。导航栏由框架或原生容器统一管理。",
97
+ "correctExample": "<template>\n <div class=\"page-container\">\n <div class=\"content\">\n <em-cell title=\"用户信息\" />\n </div>\n </div>\n</template>",
98
+ "incorrectExample": "<template>\n <div class=\"page-container\">\n <em-header title=\"页面标题\" />\n <div class=\"content\">\n <em-cell title=\"用户信息\" />\n </div>\n </div>\n</template>"
99
+ },
100
+ {
101
+ "id": "vue-no-complex-template",
102
+ "title": "避免在模板中使用复杂表达式",
103
+ "description": "复杂的逻辑应该使用计算属性,而不是直接写在模板中。",
104
+ "correctExample": "<template>\n <div>{{ activeItemNames }}</div>\n</template>\n\n<script setup>\nconst activeItemNames = computed(() =>\n items.value.filter(i => i.active).map(i => i.name).join(', ')\n);\n</script>",
105
+ "incorrectExample": "<template>\n <div>{{ items.filter(i => i.active).map(i => i.name).join(', ') }}</div>\n</template>"
106
+ },
107
+ {
108
+ "id": "vue-no-mutate-props",
109
+ "title": "避免直接修改 Props",
110
+ "description": "不要直接修改 props,应该使用 emit 通知父组件。",
111
+ "correctExample": "emit('update:value', newValue);",
112
+ "incorrectExample": "props.value = newValue;"
113
+ },
114
+ {
115
+ "id": "vue-field-clickable",
116
+ "title": "输入框交互规范",
117
+ "description": "当输入框为 readonly 但需要点击触发操作时,必须同时添加 is-link 和 clickable 属性。",
118
+ "correctExample": "<em-field\n v-model=\"date\"\n readonly\n clickable\n is-link\n label=\"选择日期\"\n @click=\"showDatePicker\"\n/>",
119
+ "incorrectExample": "<em-field\n v-model=\"date\"\n readonly\n label=\"选择日期\"\n @click=\"showDatePicker\"\n/>"
120
+ }
121
+ ]
122
+ }
File without changes
@@ -0,0 +1,76 @@
1
+ {
2
+ "category": "ajax",
3
+ "title": "Ajax 与文件上传",
4
+ "description": "核心工具集中内置的 Ajax 与 Upload,用于接口请求和文件上传",
5
+ "methods": [
6
+ {
7
+ "name": "ajax",
8
+ "description": "进行 ajax 请求,支持普通版本和 Promise 版本",
9
+ "parameters": [
10
+ { "name": "url", "type": "String", "required": true, "description": "请求的 url" },
11
+ { "name": "data", "type": "String/JSON", "required": true, "description": "请求的数据" },
12
+ { "name": "type", "type": "String", "required": false, "description": "请求类别,GET 或 POST,默认为 POST" },
13
+ { "name": "isAutoProxy", "type": "Boolean", "required": false, "description": "默认为 true,是否在请求头中携带用户 token" },
14
+ { "name": "isAutoErrToast", "type": "Boolean", "required": false, "description": "默认为 false,是否开启错误状态码自动弹窗提示" },
15
+ { "name": "success", "type": "Function", "required": false, "description": "成功回调" },
16
+ { "name": "error", "type": "Function", "required": false, "description": "失败回调" },
17
+ { "name": "complete", "type": "Function", "required": false, "description": "请求完成后的回调" },
18
+ { "name": "dataPath", "type": "String/Array", "required": false, "description": "需要获取的路径指令,例如 custom.infolist" },
19
+ { "name": "headers", "type": "Object", "required": false, "description": "设置请求的 header" },
20
+ { "name": "timeout", "type": "Number", "required": false, "description": "请求超时的毫秒数" },
21
+ { "name": "cancelKey", "type": "String", "required": false, "description": "中断请求的自定义 key 值" }
22
+ ],
23
+ "returnValue": { "type": "Promise", "description": "返回 Promise 对象,支持链式调用" },
24
+ "examples": [
25
+ {
26
+ "title": "Promise 版本",
27
+ "code": "Util.ajax({\n url: Config.serverUrl + '/api/list',\n type: 'POST',\n data: {\n params: JSON.stringify({ keyword: 'test' })\n },\n dataPath: 'custom.infolist'\n}).then((res) => {\n if (res.code === 1) {\n console.log(res.data);\n }\n}).catch((err) => {\n console.error(err);\n});",
28
+ "description": "使用 Promise 方式进行 ajax 请求"
29
+ },
30
+ {
31
+ "title": "回调版本",
32
+ "code": "Util.ajax({\n url: Config.serverUrl + '/api/detail',\n data: {\n params: JSON.stringify({ guid: '12345' })\n },\n dataPath: 'custom',\n success: (result) => {\n if (result.code === 1) {\n // 处理数据\n }\n },\n error: (err) => {\n console.error(err);\n }\n});",
33
+ "description": "使用回调方式进行 ajax 请求"
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "name": "ajaxAll",
39
+ "description": "控制多个 Ajax 请求并发执行",
40
+ "parameters": [
41
+ { "name": "...requests", "type": "Promise[]", "required": true, "description": "多个 ajax 请求的 Promise 对象" }
42
+ ],
43
+ "returnValue": { "type": "Promise<Array>", "description": "返回所有请求结果的数组" },
44
+ "examples": [
45
+ {
46
+ "title": "并发请求",
47
+ "code": "const ajax1 = Util.ajax({ url: Config.serverUrl + '/api/users' });\nconst ajax2 = Util.ajax({ url: Config.serverUrl + '/api/products' });\n\nUtil.ajaxAll(ajax1, ajax2).then((response) => {\n const users = response[0];\n const products = response[1];\n});",
48
+ "description": "同时发起多个请求并等待所有请求完成"
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "name": "upload",
54
+ "description": "将本地资源上传到开发者服务器",
55
+ "parameters": [
56
+ { "name": "url", "type": "String", "required": true, "description": "开发者服务器 url" },
57
+ { "name": "filePath", "type": "String", "required": true, "description": "要上传文件资源的路径(推荐使用)" },
58
+ { "name": "name", "type": "String", "required": true, "description": "文件对应的 key" },
59
+ { "name": "files", "type": "Array", "required": false, "description": "需要上传的文件列表(仅 H5 支持)" },
60
+ { "name": "headers", "type": "Object", "required": false, "description": "设置请求的 header" },
61
+ { "name": "formData", "type": "Object", "required": false, "description": "HTTP 请求中其他额外的 form data" },
62
+ { "name": "success", "type": "Function", "required": false, "description": "接口调用成功的回调函数" },
63
+ { "name": "error", "type": "Function", "required": false, "description": "接口调用失败的回调函数" },
64
+ { "name": "uploading", "type": "Function", "required": false, "description": "文件上传时,进度回调" }
65
+ ],
66
+ "returnValue": { "type": "Promise", "description": "返回 Promise 对象" },
67
+ "examples": [
68
+ {
69
+ "title": "文件上传",
70
+ "code": "Util.upload({\n url: Config.serverUrl + '/api/upload',\n filePath: file.path,\n name: file.name,\n formData: {\n user: 'test'\n },\n success: (res) => {\n console.log(res);\n }\n});",
71
+ "description": "上传文件到服务器"
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "category": "common",
3
+ "title": "通用工具方法",
4
+ "description": "Util 提供的通用工具方法,包括 uuid 生成、对象合并、数据处理等",
5
+ "methods": [
6
+ {
7
+ "name": "uuid",
8
+ "description": "生成一个随机 uuid",
9
+ "parameters": [
10
+ { "name": "len", "type": "Number", "required": false, "description": "长度,默认为 32 位,最大不能超过 36,最小不能小于 4" },
11
+ { "name": "radix", "type": "Number", "required": false, "description": "随机的基数,如果小于等于 10 代表只用纯数字,最大为 62,默认为 62" },
12
+ { "name": "type", "type": "String", "required": false, "description": "类别,默认为 default 代表 a-c-c-d-e 的连线模式,如果为 noline 代表不会有连线" }
13
+ ],
14
+ "returnValue": { "type": "String", "description": "生成的 uuid 字符串" },
15
+ "examples": [
16
+ {
17
+ "title": "生成默认 uuid",
18
+ "code": "const uuid = Util.uuid();\n// 例如: yczYoFSp-ooru-ANjl-Hrgg-XgXmMxSN",
19
+ "description": "生成一个 8-4-4-4-12 格式的 32 位 uuid"
20
+ },
21
+ {
22
+ "title": "生成纯数字 uuid",
23
+ "code": "const uuid = Util.uuid({ len: 36, radix: 10 });\n// 例如: 52616056-5161-7170-8460-802618729824",
24
+ "description": "生成一个只有数字的 36 位 uuid"
25
+ }
26
+ ]
27
+ },
28
+ {
29
+ "name": "getExtraDataByKey",
30
+ "description": "通过传入 key 值,得到页面 key 的初始化传值",
31
+ "parameters": [
32
+ { "name": "key", "type": "String", "required": true, "description": "对应的 key 值" }
33
+ ],
34
+ "returnValue": { "type": "String", "description": "返回 href 中对应的 key 的 value" },
35
+ "examples": [
36
+ {
37
+ "title": "获取页面参数",
38
+ "code": "const value = Util.getExtraDataByKey('id');\nconsole.log(value);",
39
+ "description": "获取 URL 中的参数值"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "name": "getFullUrlByParams",
45
+ "description": "将 json 参数拼接到 url 中",
46
+ "parameters": [
47
+ { "name": "url", "type": "String", "required": true, "description": "需要拼接的 url" },
48
+ { "name": "data", "type": "JSON", "required": true, "description": "对应需要拼接的 JSON 参数" },
49
+ { "name": "isType", "type": "Boolean", "required": false, "description": "是否相对路径,默认 false" }
50
+ ],
51
+ "returnValue": { "type": "String", "description": "拼接后的完整 URL" },
52
+ "examples": [
53
+ {
54
+ "title": "拼接 URL 参数",
55
+ "code": "const url = 'http://app.epoint.com.cn/api';\nconst data = { key1: 'value1' };\nconst finalUrl = Util.getFullUrlByParams(url, data);\n// 返回: http://app.epoint.com.cn/api?key1=value1",
56
+ "description": "将 JSON 参数拼接到 URL 中"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "name": "extend",
62
+ "description": "合并多个对象",
63
+ "parameters": [
64
+ { "name": "deep", "type": "Boolean", "required": false, "description": "为 true 时会进行递归合并" },
65
+ { "name": "target", "type": "Object", "required": true, "description": "需要合并的目标对象" },
66
+ { "name": "source1", "type": "Object", "required": true, "description": "需要合并的源对象" },
67
+ { "name": "sourceN", "type": "Object", "required": false, "description": "更多需要合并的源对象" }
68
+ ],
69
+ "returnValue": { "type": "Object", "description": "合并后的对象" },
70
+ "examples": [
71
+ {
72
+ "title": "浅合并",
73
+ "code": "const target = { a: 1 };\nconst source = { b: 2 };\nconst result = Util.extend({}, target, source);\n// { a: 1, b: 2 }",
74
+ "description": "浅合并多个对象"
75
+ },
76
+ {
77
+ "title": "深合并",
78
+ "code": "const target = { product: { ejs: 'ejs' } };\nconst source = { product: { m7: 'm7' } };\nconst result = Util.extend(true, {}, target, source);\n// { product: { ejs: 'ejs', m7: 'm7' } }",
79
+ "description": "递归合并多个对象"
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ "name": "each",
85
+ "description": "遍历对象或数组",
86
+ "parameters": [
87
+ { "name": "object", "type": "Object/Array", "required": true, "description": "需要遍历的对象或数组" },
88
+ { "name": "handler", "type": "Function", "required": true, "description": "每个元素执行的回调函数" }
89
+ ],
90
+ "returnValue": { "type": "void", "description": "无返回值" },
91
+ "examples": [
92
+ {
93
+ "title": "遍历数组",
94
+ "code": "const array = [1, 2, 3];\nUtil.each(array, function(index, item) {\n console.log(item * item);\n});",
95
+ "description": "遍历数组并处理每个元素"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "name": "dataProcess",
101
+ "description": "处理返回数据,返回按指令处理过后的最终数据",
102
+ "parameters": [
103
+ { "name": "response", "type": "JSON", "required": true, "description": "需要处理的数据" },
104
+ { "name": "options.dataPath", "type": "String/Array", "required": false, "description": "需要获取的路径指令" }
105
+ ],
106
+ "returnValue": { "type": "Object", "description": "包含 code、message、data 的处理结果" },
107
+ "examples": [
108
+ {
109
+ "title": "处理接口返回数据",
110
+ "code": "const response = {\n custom: { infolist: [{ title: '测试' }] },\n status: { code: 1, text: '成功' }\n};\nconst result = Util.dataProcess(response, {\n dataPath: 'custom.infolist'\n});\nconsole.log(result.data);",
111
+ "description": "从接口返回数据中提取指定路径的数据"
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ "name": "os",
117
+ "description": "判断当前的运行环境",
118
+ "parameters": [],
119
+ "returnValue": { "type": "Object", "description": "包含 android、ios、ejs、h5、wechat 等环境判断属性" },
120
+ "examples": [
121
+ {
122
+ "title": "判断运行环境",
123
+ "code": "if (Util.os.android) {\n console.log('Android 环境');\n}\nif (Util.os.ios) {\n console.log('iOS 环境');\n}\nif (Util.os.h5) {\n console.log('H5 环境');\n}",
124
+ "description": "判断当前代码运行的平台环境"
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "categories": [
3
+ { "id": "ajax", "title": "Ajax 与文件上传", "file": "ajax.json" },
4
+ { "id": "string", "title": "字符串校验工具", "file": "string.json" },
5
+ { "id": "common", "title": "通用工具方法", "file": "common.json" }
6
+ ]
7
+ }