fix(setting-stylePanel): 只允许有一个 id,样式选择器只能添加一个 id (#295)

This commit is contained in:
chilingling 2024-02-20 15:20:48 +08:00 committed by GitHub
parent 3e1cb599d7
commit 34dfbc624e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -218,7 +218,7 @@ const editClassName = (curClassName, optionType = OPTION_TYPE.ADD, oldSelector =
res = `${typeMap[type] ?? ''} ${newClassNames}`
} else {
//
//
res = typeMap[type]
.split(' ')
.map((item) => {
@ -235,6 +235,10 @@ const editClassName = (curClassName, optionType = OPTION_TYPE.ADD, oldSelector =
}
const addSelectorHandler = () => {
if (type === SELECTOR_TYPE.ID) {
return newClassNames
}
return `${typeMap[type] ?? ''} ${newClassNames}`
}