From 97d8a1b043a0b6ce93269f4a4b7c3160619ccae1 Mon Sep 17 00:00:00 2001 From: "huajingwen@didiglobal.com" Date: Mon, 26 Aug 2024 18:17:24 +0800 Subject: [PATCH] feat: --- .../lib/platform/style/wx/index.js | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/webpack-plugin/lib/platform/style/wx/index.js b/packages/webpack-plugin/lib/platform/style/wx/index.js index 2b4cd0aadf..e682521fa2 100644 --- a/packages/webpack-plugin/lib/platform/style/wx/index.js +++ b/packages/webpack-plugin/lib/platform/style/wx/index.js @@ -101,6 +101,26 @@ module.exports = function getSpec ({ warn, error }) { borderStyle: ValueType.default, borderColor: ValueType.color }, + 'border-left': { // 仅支持 width | style | color 这种排序 + borderLeftWidth: ValueType.number, + borderLeftStyle: ValueType.default, + borderLeftColor: ValueType.color + }, + 'border-right': { // 仅支持 width | style | color 这种排序 + borderRightWidth: ValueType.number, + borderRightStyle: ValueType.default, + borderRightColor: ValueType.color + }, + 'border-top': { // 仅支持 width | style | color 这种排序 + borderTopWidth: ValueType.number, + borderTopStyle: ValueType.default, + borderTopColor: ValueType.color + }, + 'border-bottom': { // 仅支持 width | style | color 这种排序 + borderBottomWidth: ValueType.number, + borderBottomStyle: ValueType.default, + borderBottomColor: ValueType.color + }, 'box-shadow': { // 仅支持 offset-x | offset-y | blur-radius | color 排序 'shadowOffset.width': ValueType.number, 'shadowOffset.height': ValueType.number, @@ -339,7 +359,7 @@ module.exports = function getSpec ({ warn, error }) { supportedModes: ['ios', 'android'], rules: [ { // 背景相关属性的处理 - test: /.*background*./, + test: /^(background|background-image|background-color|background-size|background-repeat|background-position)$/, ios: checkBackgroundImage, android: checkBackgroundImage }, @@ -372,7 +392,7 @@ module.exports = function getSpec ({ warn, error }) { android: getAbbreviationAndroid }, { - test: /.*font-variant.*/, + test: /^(font-variant|font-variant-caps|font-variant-numeric|font-variant-east-asian|font-variant-alternates|font-variant-ligatures)$/, ios: getFontVariant, android: getFontVariant }, @@ -382,7 +402,7 @@ module.exports = function getSpec ({ warn, error }) { android: getBorderRadius }, { // margin padding 内外边距的处理 - test: /.*(margin|padding).*/, + test: /^(margin|padding)$/, ios: formatMargins, android: formatMargins }, @@ -398,13 +418,13 @@ module.exports = function getSpec ({ warn, error }) { android: formatLineHeight }, // 值类型校验放到最后 - { // color 颜色值校验 - test: /.*color.*/i, + { // color 颜色值校验 color xx-color 等 + test: /^(color|(.+-color))$/, ios: checkCommonValue(ValueType.color), android: checkCommonValue(ValueType.color) }, - { // number 值校验 - test: /.*width|height|left|right|top|bottom|radius|margin|padding|spacing|offset|size.*/i, + { // number 值校验 // width height xx-left xx-top 等 + test: /^((width|height)|(.+-(left|right|top|bottom|radius|spacing|size)))$/, ios: checkCommonValue(ValueType.number), android: checkCommonValue(ValueType.number) }