m8-mcp-server 1.0.5 → 1.0.6

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 (129) hide show
  1. package/dist/cli.d.ts +1 -1
  2. package/dist/cli.js +1 -1
  3. package/dist/docs/apis.d.ts +1 -1
  4. package/dist/docs/apis.js +1 -1
  5. package/dist/docs/components.d.ts +1 -1
  6. package/dist/docs/components.js +1 -1
  7. package/dist/docs/index.d.ts +1 -1
  8. package/dist/docs/index.js +1 -1
  9. package/dist/docs/loader.d.ts +1 -1
  10. package/dist/docs/loader.js +1 -1
  11. package/dist/docs/search.d.ts +1 -1
  12. package/dist/docs/search.js +1 -1
  13. package/dist/docs/standards.d.ts +1 -1
  14. package/dist/docs/standards.js +1 -1
  15. package/dist/docs/utils.d.ts +1 -1
  16. package/dist/docs/utils.js +1 -1
  17. package/dist/generator/header.d.ts +1 -1
  18. package/dist/generator/header.js +1 -1
  19. package/dist/generator/index.d.ts +1 -1
  20. package/dist/generator/index.js +1 -1
  21. package/dist/generator/vue-template.d.ts +1 -1
  22. package/dist/generator/vue-template.js +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/recommend/index.d.ts +1 -1
  26. package/dist/recommend/index.js +1 -1
  27. package/dist/tools/generate-code.d.ts +1 -1
  28. package/dist/tools/generate-code.js +1 -1
  29. package/dist/tools/get-api-info.d.ts +1 -1
  30. package/dist/tools/get-api-info.js +1 -1
  31. package/dist/tools/get-coding-standard.d.ts +1 -1
  32. package/dist/tools/get-coding-standard.js +1 -1
  33. package/dist/tools/get-component-info.d.ts +1 -1
  34. package/dist/tools/get-component-info.js +1 -1
  35. package/dist/tools/get-util-info.d.ts +1 -1
  36. package/dist/tools/get-util-info.js +1 -1
  37. package/dist/tools/index.d.ts +1 -1
  38. package/dist/tools/index.js +1 -1
  39. package/dist/tools/recommend-solution.d.ts +1 -1
  40. package/dist/tools/recommend-solution.js +1 -1
  41. package/dist/tools/search-docs.d.ts +1 -1
  42. package/dist/tools/search-docs.js +1 -1
  43. package/dist/types/index.d.ts +1 -1
  44. package/dist/types/index.js +1 -1
  45. package/package.json +3 -4
  46. package/resources/cases/.gitkeep +0 -0
  47. package/resources/cases/form-submit-vue2.json +0 -15
  48. package/resources/cases/index.json +0 -8
  49. package/resources/cases/list-detail-vue2.json +0 -27
  50. package/resources/components/.gitkeep +0 -0
  51. package/resources/components/actionsheet.json +0 -199
  52. package/resources/components/amap.json +0 -66
  53. package/resources/components/area.json +0 -158
  54. package/resources/components/badge.json +0 -93
  55. package/resources/components/button.json +0 -260
  56. package/resources/components/calendar.json +0 -225
  57. package/resources/components/cascader.json +0 -115
  58. package/resources/components/cell.json +0 -85
  59. package/resources/components/chart.json +0 -55
  60. package/resources/components/checkbox.json +0 -158
  61. package/resources/components/circle.json +0 -138
  62. package/resources/components/collapse.json +0 -88
  63. package/resources/components/countdown.json +0 -105
  64. package/resources/components/datepicker.json +0 -216
  65. package/resources/components/dialog.json +0 -250
  66. package/resources/components/divider.json +0 -82
  67. package/resources/components/dragsort.json +0 -67
  68. package/resources/components/dropdownmenu.json +0 -129
  69. package/resources/components/easycalendar.json +0 -84
  70. package/resources/components/empty.json +0 -90
  71. package/resources/components/field.json +0 -423
  72. package/resources/components/form.json +0 -156
  73. package/resources/components/grid.json +0 -131
  74. package/resources/components/header.json +0 -147
  75. package/resources/components/icon.json +0 -104
  76. package/resources/components/image.json +0 -169
  77. package/resources/components/imagepreview.json +0 -150
  78. package/resources/components/imagescale.json +0 -245
  79. package/resources/components/index.json +0 -72
  80. package/resources/components/indexbar.json +0 -83
  81. package/resources/components/layout.json +0 -74
  82. package/resources/components/lazyload.json +0 -46
  83. package/resources/components/loading.json +0 -103
  84. package/resources/components/minirefresh.json +0 -341
  85. package/resources/components/noticebar.json +0 -148
  86. package/resources/components/notify.json +0 -60
  87. package/resources/components/numberkeyboard.json +0 -216
  88. package/resources/components/overlay.json +0 -78
  89. package/resources/components/pagination.json +0 -137
  90. package/resources/components/panel.json +0 -87
  91. package/resources/components/passwordinput.json +0 -103
  92. package/resources/components/picker.json +0 -195
  93. package/resources/components/popover.json +0 -161
  94. package/resources/components/popup.json +0 -229
  95. package/resources/components/progress.json +0 -111
  96. package/resources/components/qrcode.json +0 -128
  97. package/resources/components/radio.json +0 -139
  98. package/resources/components/rate.json +0 -157
  99. package/resources/components/rtc.json +0 -35
  100. package/resources/components/search.json +0 -234
  101. package/resources/components/selectperson.json +0 -175
  102. package/resources/components/sidebar.json +0 -74
  103. package/resources/components/skeleton.json +0 -110
  104. package/resources/components/slider.json +0 -159
  105. package/resources/components/stepper.json +0 -241
  106. package/resources/components/steps.json +0 -108
  107. package/resources/components/sticky.json +0 -72
  108. package/resources/components/swipe.json +0 -146
  109. package/resources/components/swipecell.json +0 -118
  110. package/resources/components/switch.json +0 -123
  111. package/resources/components/switchcell.json +0 -123
  112. package/resources/components/tab.json +0 -257
  113. package/resources/components/tabbar.json +0 -137
  114. package/resources/components/table.json +0 -149
  115. package/resources/components/tag.json +0 -149
  116. package/resources/components/toast.json +0 -70
  117. package/resources/components/treeselect.json +0 -106
  118. package/resources/components/uploader.json +0 -283
  119. package/resources/components/verifycode.json +0 -94
  120. package/resources/standards/.gitkeep +0 -0
  121. package/resources/standards/css.json +0 -108
  122. package/resources/standards/javascript.json +0 -129
  123. package/resources/standards/project-structure.json +0 -101
  124. package/resources/standards/vue.json +0 -122
  125. package/resources/utils/.gitkeep +0 -0
  126. package/resources/utils/ajax.json +0 -76
  127. package/resources/utils/common.json +0 -129
  128. package/resources/utils/index.json +0 -7
  129. package/resources/utils/string.json +0 -112
package/dist/cli.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * M8 MCP Server CLI 入口
4
- * @作者 M8 Team
4
+ * @作者 li peng
5
5
  * @创建时间 2024-12-29
6
6
  * @描述 命令行入口,用于启动 MCP Server
7
7
  */
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * M8 MCP Server CLI 入口
4
- * @作者 M8 Team
4
+ * @作者 li peng
5
5
  * @创建时间 2024-12-29
6
6
  * @描述 命令行入口,用于启动 MCP Server
7
7
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * EJS API 信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 EJS 原生 API 信息的查询功能
6
6
  */
package/dist/docs/apis.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * EJS API 信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 EJS 原生 API 信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 组件信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 UI 组件信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 组件信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 UI 组件信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Document Manager 主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 文档管理器,提供文档加载、搜索和查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Document Manager 主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 文档管理器,提供文档加载、搜索和查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文档加载器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 负责加载编码规范、组件文档、工具文档和典型案例
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文档加载器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 负责加载编码规范、组件文档、工具文档和典型案例
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文档搜索功能
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现文档的关键词搜索和分类过滤
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文档搜索功能
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现文档的关键词搜索和分类过滤
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 编码规范查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现编码规范信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 编码规范查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现编码规范信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Util 工具信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 Util 工具方法信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Util 工具信息查询
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 实现 Util 工具方法信息的查询功能
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文件头注释生成器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 生成符合 M8 规范的文件头部注释
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 文件头注释生成器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 生成符合 M8 规范的文件头部注释
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 代码生成器主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求生成符合 M8 规范的代码,包括 Vue、SCSS、Router、Mock 等
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 代码生成器主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求生成符合 M8 规范的代码,包括 Vue、SCSS、Router、Mock 等
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Vue 模板生成器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 生成 Vue2 和 Vue3 组件模板,严格遵循 M8 规范
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Vue 模板生成器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 生成 Vue2 和 Vue3 组件模板,严格遵循 M8 规范
6
6
  */
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * M8 MCP Server 主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 MCP Server 实现,提供文档查询、智能推荐和代码生成服务
6
6
  */
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * M8 MCP Server 主入口
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 MCP Server 实现,提供文档查询、智能推荐和代码生成服务
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 推荐引擎
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求智能推荐组件、API 和工具方法
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 推荐引擎
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求智能推荐组件、API 和工具方法
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * generate_code 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求生成符合 M8 框架规范的代码,严格遵循内置规范
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * generate_code 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求生成符合 M8 框架规范的代码,严格遵循内置规范
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_api_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 EJS 原生 API 的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_api_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 EJS 原生 API 的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_coding_standard 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取编码规范
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_coding_standard 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取编码规范
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_component_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 M8 UI 组件的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_component_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 M8 UI 组件的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_util_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 M8 Util 工具方法的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * get_util_info 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 获取 M8 Util 工具方法的详细信息
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Tool Manager - 工具管理器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 管理所有 MCP 工具的注册和调用
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Tool Manager - 工具管理器
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 管理所有 MCP 工具的注册和调用
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * recommend_solution 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求智能推荐合适的组件、API 或工具方法
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * recommend_solution 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 根据需求智能推荐合适的组件、API 或工具方法
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * search_docs 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 搜索 M8 框架文档
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * search_docs 工具实现
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 搜索 M8 框架文档
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * M8 MCP Server 核心类型定义
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 定义 MCP Server 所需的所有接口和类型
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * M8 MCP Server 核心类型定义
3
- * @作者 M8 Team
3
+ * @作者 li peng
4
4
  * @创建时间 2024-12-29
5
5
  * @描述 定义 MCP Server 所需的所有接口和类型
6
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m8-mcp-server",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "M8 移动前端跨端框架 MCP Server - 提供文档查询、智能推荐和代码生成服务",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -24,11 +24,10 @@
24
24
  "vue",
25
25
  "code-generation"
26
26
  ],
27
- "author": "",
27
+ "author": "lipeng",
28
28
  "license": "MIT",
29
29
  "files": [
30
- "dist",
31
- "resources"
30
+ "dist"
32
31
  ],
33
32
  "engines": {
34
33
  "node": ">=18.0.0"
File without changes
@@ -1,15 +0,0 @@
1
- {
2
- "id": "form-submit-vue2",
3
- "title": "表单提交 (Vue2/M8.3)",
4
- "description": "使用 M8.3 移动前端框架进行表单页面的开发和提交",
5
- "category": "form-submit",
6
- "vueVersion": 2,
7
- "files": [
8
- {
9
- "name": "form.vue",
10
- "path": "src/pages/m8demo/form.vue",
11
- "description": "表单页面组件",
12
- "code": "<!--\n * @作者: 开发者\n * @创建时间: 2024-12-29\n * @修改时间: 2024-12-29\n * @版本: [1.0]\n * @版权: 国泰新点软件股份有限公司\n * @描述: 表单提交示例页面\n-->\n<template>\n <view class=\"container\">\n <em-form ref=\"form\" :model=\"formData\" :rules=\"rules\">\n <em-cell-group>\n <em-field\n v-model=\"formData.name\"\n name=\"name\"\n label=\"姓名\"\n placeholder=\"请输入姓名\"\n required\n />\n <em-field\n v-model=\"formData.phone\"\n name=\"phone\"\n type=\"tel\"\n label=\"手机号\"\n placeholder=\"请输入手机号\"\n required\n />\n <em-field\n v-model=\"formData.date\"\n name=\"date\"\n label=\"日期\"\n placeholder=\"请选择日期\"\n readonly\n clickable\n is-link\n @click=\"showDatePicker = true\"\n />\n <em-field\n v-model=\"formData.remark\"\n name=\"remark\"\n type=\"textarea\"\n label=\"备注\"\n placeholder=\"请输入备注\"\n :autosize=\"{ minHeight: 80 }\"\n />\n </em-cell-group>\n </em-form>\n \n <view class=\"btn-wrapper\">\n <em-button type=\"primary\" block @click=\"onSubmit\">提交</em-button>\n </view>\n \n <em-datepicker\n v-model=\"showDatePicker\"\n @confirm=\"onDateConfirm\"\n />\n </view>\n</template>\n\n<script>\nexport default {\n data() {\n return {\n formData: {\n name: '',\n phone: '',\n date: '',\n remark: ''\n },\n rules: {\n name: [{ required: true, message: '请输入姓名' }],\n phone: [\n { required: true, message: '请输入手机号' },\n { pattern: /^1[3-9]\\d{9}$/, message: '手机号格式不正确' }\n ]\n },\n showDatePicker: false\n };\n },\n methods: {\n onDateConfirm(value) {\n this.formData.date = value;\n this.showDatePicker = false;\n },\n async onSubmit() {\n try {\n await this.$refs.form.validate();\n \n ejs.ui.showWaiting({ message: '提交中...' });\n \n const result = await Util.ajax({\n url: Config.serverUrl + '/rest/submit',\n type: 'POST',\n data: {\n params: JSON.stringify(this.formData)\n }\n });\n \n ejs.ui.closeWaiting();\n \n if (result && result.status && result.status.code === 1) {\n ejs.ui.toast({ message: '提交成功' });\n ejs.page.close();\n } else {\n ejs.ui.toast({ message: result.status.text || '提交失败' });\n }\n } catch (error) {\n ejs.ui.closeWaiting();\n console.error('表单验证失败:', error);\n }\n }\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.container {\n padding-bottom: 80px;\n}\n.btn-wrapper {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n padding: 16px;\n background: #fff;\n}\n</style>"
13
- }
14
- ]
15
- }
@@ -1,8 +0,0 @@
1
- {
2
- "cases": [
3
- { "id": "list-detail-vue2", "title": "列表详情 (Vue2/M8.3)", "category": "list-detail", "vueVersion": 2, "file": "list-detail-vue2.json" },
4
- { "id": "list-detail-vue3", "title": "列表详情 (Vue3/M8.4)", "category": "list-detail", "vueVersion": 3, "file": "list-detail-vue3.json" },
5
- { "id": "form-submit-vue2", "title": "表单提交 (Vue2/M8.3)", "category": "form-submit", "vueVersion": 2, "file": "form-submit-vue2.json" },
6
- { "id": "form-submit-vue3", "title": "表单提交 (Vue3/M8.4)", "category": "form-submit", "vueVersion": 3, "file": "form-submit-vue3.json" }
7
- ]
8
- }
@@ -1,27 +0,0 @@
1
- {
2
- "id": "list-detail-vue2",
3
- "title": "列表详情 (Vue2/M8.3)",
4
- "description": "使用 M8.3 移动前端框架进行下拉刷新列表、详情页面的开发",
5
- "category": "list-detail",
6
- "vueVersion": 2,
7
- "files": [
8
- {
9
- "name": "router.js",
10
- "path": "src/pages/m8demo/router.js",
11
- "description": "路由配置文件",
12
- "code": "/**\n * router.js无需import组件,需要path路径与vue组件名称保持匹配。\n */\nconst routes = [\n {\n path: 'pages/m8demo/list',\n style: {\n navigationBarTitleText: '列表页面',\n },\n },\n {\n path: 'pages/m8demo/detail',\n style: {\n navigationBarTitleText: '详情页面',\n },\n },\n];\n\nexport default routes;"
13
- },
14
- {
15
- "name": "list.vue",
16
- "path": "src/pages/m8demo/list.vue",
17
- "description": "列表页面组件",
18
- "code": "<template>\n <view class=\"container\">\n <em-minirefresh\n ref=\"scrollPull\"\n :initPageIndex=\"initPageIndex\"\n :page-size=\"pageSize\"\n :url=\"url\"\n :request-data=\"dataRequest\"\n :change-data=\"dataChange\"\n >\n <template v-slot:default=\"{ listData }\">\n <em-cell v-for=\"(item, index) in listData\" :key=\"index\" :title=\"item.title\" @click=\"itemClick(item)\" />\n </template>\n </em-minirefresh>\n </view>\n</template>\n\n<script>\nexport default {\n data() {\n return {\n url: `${Config.serverUrl}/rest/list`,\n initPageIndex: 0,\n pageSize: 10\n };\n },\n methods: {\n dataRequest(currPage, pageSize) {\n return {\n params: JSON.stringify({\n currentpageindex: currPage,\n pagesize: pageSize\n })\n };\n },\n dataChange(res) {\n if (res && res.status && res.status.code === 1) {\n return res.custom.infolist;\n }\n console.error('接口返回参数错误');\n return [];\n },\n itemClick(item) {\n ejs.page.open({\n pageUrl: './detail',\n data: { id: item.id }\n });\n }\n }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.container {\n height: 100vh;\n}\n</style>"
19
- },
20
- {
21
- "name": "detail.vue",
22
- "path": "src/pages/m8demo/detail.vue",
23
- "description": "详情页面组件",
24
- "code": "<template>\n <div class=\"container\">\n <h1>{{ title }}</h1>\n <div v-html=\"content\"></div>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'detail',\n data() {\n return {\n title: '',\n content: ''\n };\n },\n created() {\n const id = Util.getExtraDataByKey('id') || '';\n this.getDetail(id);\n },\n methods: {\n getDetail(id) {\n Util.ajax({\n url: `${Config.serverUrl}/rest/detail`,\n data: {\n params: JSON.stringify({ guid: id })\n }\n })\n .then((result) => {\n if (result && result.status && result.status.code === 1) {\n this.title = result.custom.info.title;\n this.content = result.custom.info.data;\n }\n })\n .catch((err) => {\n console.error(err);\n });\n }\n }\n};\n</script>\n\n<style lang=\"scss\" scoped></style>"
25
- }
26
- ]
27
- }
File without changes