Skip to content

Commit

Permalink
fix cr
Browse files Browse the repository at this point in the history
  • Loading branch information
huajingwen@didiglobal.com committed May 14, 2024
1 parent d11ea0c commit baf2031
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/webpack-plugin/lib/platform/style/wx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ module.exports = function getSpec ({ warn, error }) {
flexGrow: ValueType.number,
flexShrink: ValueType.number,
flexBasis: ValueType.number
},
'flex-flow': { // 仅支持 flex-flow: <'flex-direction'> or flex-flow: <'flex-direction'> and <'flex-wrap'>
flexDirection: ValueType.default,
flexWrap: ValueType.default
}
}

Expand Down Expand Up @@ -180,7 +184,6 @@ module.exports = function getSpec ({ warn, error }) {
return cssMap
}

const commonAbbreviationExp = /^(text-shadow|border)$/
const getAbbreviation = ({ prop, value }) => {
const keyMap = AbbreviationMap[prop]
return formatAbbreviation({ prop, value, keyMap })
Expand Down Expand Up @@ -227,11 +230,6 @@ module.exports = function getSpec ({ warn, error }) {
ios: unsupportedValueError,
android: unsupportedValueError
},
{ // 通用的简写格式匹配
test: commonAbbreviationExp,
ios: getAbbreviation,
android: getAbbreviation
},
{
test: 'box-shadow',
ios: getAbbreviation,
Expand Down Expand Up @@ -265,12 +263,18 @@ module.exports = function getSpec ({ warn, error }) {
ios: formatBoxReviation,
android: formatBoxReviation
},
// 需要过滤的属性返回value=false
// 需要过滤的属性返回value=false Todo value 校验
{
test: /^-(webkit|moz|ms|o)-/,
ios: needDelProps,
android: needDelProps
},
// 通用的简写格式匹配
{
test: new RegExp('^(' + Object.keys(AbbreviationMap).join('|') + ')$'),
ios: getAbbreviation,
android: getAbbreviation
},
// 值类型校验放到最后
{ // color 颜色值校验
test: /.*color.*/i,
Expand Down

0 comments on commit baf2031

Please sign in to comment.