Skip to content

Commit 102b8bb

Browse files
oneyouziyucongshuang
andauthored
修改version版本取值方式,灵感组件id更新 (#123)
* 新版更改预览webjs版本同媒介查询参数一致,同时兼容旧版ide的方式 * 新版更改预览webjs版本同媒介查询参数一致,同时兼容旧版ide的方式 --------- Co-authored-by: yucongshuang <[email protected]>
1 parent b5d68bb commit 102b8bb

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

packages/hap-compiler/src/style/validator.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,21 +401,15 @@ const validateTime = function (v) {
401401
}
402402
// 灵感组件颜色值
403403
const themeColors = [
404-
'uxCardColorTheme',
404+
'uxCardColorBackground',
405405
'uxCardColorAccent',
406-
'uxCardColorPrimary',
407-
'uxCardColorSecondary',
408-
'uxCardColorSecondaryVariant',
409-
'uxCardColorTertiary',
410-
'uxCardColorQuaternary',
411406
'uxCardColorContainer',
412-
'uxCardBackground',
413407
'uxCardColorHue',
414408
'uxCardColorHueSecondary',
415-
'uxIconColorAccent',
416-
'uxIconColorPrimary',
417-
'uxIconColorSecondary',
418-
'uxIconColorBackground'
409+
'uxCardColorPrimary',
410+
'uxCardColorQuaternary',
411+
'uxCardColorSecondaryVariant',
412+
'uxCardColorTertiary'
419413
]
420414
const validator = {
421415
/**
@@ -2711,9 +2705,8 @@ const validatorMap = {
27112705
themeColor: makeEnumValidator(themeColors),
27122706
themeBackgroundColor: makeEnumValidator(themeColors),
27132707
themeLayerColor: makeEnumValidator(themeColors),
2714-
themeThumbColor: makeEnumValidator(themeColors),
27152708
themeTrackColor: makeEnumValidator(themeColors),
2716-
themeSelectColor: makeEnumValidator(themeColors),
2709+
themeSelectedColor: makeEnumValidator(themeColors),
27172710
themeBlockColor: makeEnumValidator(themeColors),
27182711
letterSpacing: validator.letterSpacing
27192712
}

packages/hap-server/src/preview/create-router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export default async function createRouter(previewTarget) {
226226
type,
227227
script,
228228
scriptNotFound: !scriptExists(script),
229-
webJsUrl: genWebJsUrl(ctx.conf.options.webVersion),
229+
webJsUrl: genWebJsUrl(browerOptions.options.version || ctx.conf.options.webVersion), // 更改预览版本号修改为同媒介查询一样的传参方式,同时兼容之前的方式
230230
language: currentLanguage,
231231
mediaQueryParams: JSON.stringify(mediaQueryParams) // 传给页面的媒介查询参数
232232
})

0 commit comments

Comments
 (0)