ai-direct-platform-ui.config.json
2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
"_comment": "多端组件降级配置文件。可根据项目和团队约定自行调整,生成管线会动态读取此文件决定首选 VUI 包与降级组件库。",
"platforms": {
"pc": {
"label": "PC 管理后台 / Web Admin",
"preferredVuiPackage": "@vui/vue",
"fallbackPackages": ["element-plus"],
"cliTemplate": "vue",
"cliUiOption": "element-plus",
"componentHints": [
"PC 端使用 VInput、VSelect、VTable、VButton、VDialog 等 @vui/vue 组件",
"降级时使用 Element Plus 的 ElInput、ElSelect、ElTable、ElButton、ElDialog"
]
},
"mobile": {
"label": "移动端 H5 / Mobile Web",
"_note": "第一顺位 @vui/mobile,第二顺位降级到 Vant 4,第三顺位 HTML 原生组件。禁止使用 @vui/vue 的 PC 端组件。",
"preferredVuiPackage": "@vui/mobile",
"fallbackPackages": ["vant"],
"cliTemplate": "mobile",
"cliUiOption": "vant",
"componentHints": [
"第一顺位使用 @vui/mobile 组件:VButton、VCell、VDropdownMenu、VDropdownItem、VField、VImage、VList、VNavBar、VPicker、VPopup、VSearch、VSection、VSwiper、VTabbar、VTabs",
"若 @vui/mobile 未覆盖当前场景,降级到 Vant 4 原生组件(van-field、van-picker、van-cell 等)",
"Vant 4 基于 Vue 3 + TypeScript,组件使用 kebab-case 前缀 van-",
"第三顺位使用 HTML 原生组件",
"禁止使用 @vui/vue 的 VInput/VSelect/VTable/VButton/VDialog 等 PC 端组件"
]
},
"miniprogram": {
"label": "小程序 / Mini Program",
"preferredVuiPackage": "@vui/uniapp",
"fallbackPackages": ["@vant/weapp"],
"cliTemplate": "",
"cliUiOption": "",
"componentHints": [
"小程序端优先使用 @vui/uniapp 的 uni-app 组件",
"降级时使用 Vant Weapp 的组件(van-field、van-picker、van-button、van-cell 等)",
"小程序组件使用 WXML/WXSS 语法,注意组件通信和生命周期差异"
]
},
"react": {
"label": "React PC 端",
"preferredVuiPackage": "@vui/react",
"fallbackPackages": ["antd"],
"cliTemplate": "react",
"cliUiOption": "antd",
"componentHints": [
"React 端使用 @vui/react 的组件",
"降级时使用 Ant Design 的组件"
]
},
"unknown": {
"label": "未知平台",
"preferredVuiPackage": "",
"fallbackPackages": [],
"cliTemplate": "",
"cliUiOption": "",
"componentHints": []
}
},
"detectionRules": {
"miniprogram": {
"anyDependency": [
"@dcloudio/uni-mp-weixin",
"@dcloudio/uni-mp-alipay",
"@dcloudio/uni-mp-baidu",
"@dcloudio/uni-mp-toutiao",
"@dcloudio/uni-mp-qq",
"miniprogram-ci",
"@tarojs/taro"
],
"anyPathSegment": ["miniprogram", "mp-weixin", "mp-alipay"]
},
"mobile": {
"anyDependency": [
"vant",
"@vant/auto-import-resolver",
"vant-use",
"@nutui/nutui"
],
"anyPathSegment": ["mobile", "h5"]
}
}
}