File tree Expand file tree Collapse file tree 2 files changed +39
-5
lines changed
packages/uni-mp-xhs/src/compiler Expand file tree Collapse file tree 2 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 55 createCopyPluginTarget ,
66 getNativeTags ,
77 transformComponentLink ,
8+ transformDirection ,
89 // transformMatchMedia,
910 transformRef ,
1011} from '@dcloudio/uni-cli-shared'
@@ -16,18 +17,25 @@ import {
1617import source from './project.config.json'
1718import { transformOn } from './transforms/vOn'
1819import { transformModel } from './transforms/vModel'
20+ import { transformMPBuiltInTag } from './transforms/transformMPBuiltInTag'
1921
2022const directiveTransforms = {
2123 on : transformOn ,
2224 model : transformModel ,
2325}
2426
27+ const nodeTransforms = [
28+ transformRef ,
29+ transformComponentLink ,
30+ // transformMatchMedia
31+ ]
32+
33+ if ( process . env . UNI_APP_X === 'true' ) {
34+ nodeTransforms . push ( transformMPBuiltInTag , transformDirection )
35+ }
36+
2537export const compilerOptions : CompilerOptions = {
26- nodeTransforms : [
27- transformRef ,
28- transformComponentLink ,
29- // transformMatchMedia
30- ] ,
38+ nodeTransforms,
3139 directiveTransforms,
3240}
3341
Original file line number Diff line number Diff line change 1+ import { createMPBuiltInTagTransform } from '@dcloudio/uni-cli-shared'
2+
3+ const transformMPBuiltInTagOptions = {
4+ propRename : {
5+ checkbox : {
6+ foreColor : 'color' ,
7+ } ,
8+ radio : {
9+ activeBackgroundColor : 'color' ,
10+ } ,
11+ slider : {
12+ activeBackgroundColor : 'active-color' ,
13+ foreColor : 'block-color' ,
14+ } ,
15+ switch : {
16+ activeBackgroundColor : 'color' ,
17+ } ,
18+ } ,
19+ tagRename : {
20+ 'list-view' : 'scroll-view' ,
21+ } ,
22+ }
23+
24+ export const transformMPBuiltInTag = createMPBuiltInTagTransform (
25+ transformMPBuiltInTagOptions
26+ )
You can’t perform that action at this time.
0 commit comments