feat: 完善官网配置、预约管理与文章编辑
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
showError,
|
||||
showSuccess,
|
||||
showWarning,
|
||||
toBoolean,
|
||||
} from '../../../helpers';
|
||||
|
||||
// InputNumber 清空时 onChange 会收到 ''/null,parseInt 得到 NaN,
|
||||
@@ -76,12 +77,11 @@ export default function SettingsSkillInject(props) {
|
||||
useEffect(() => {
|
||||
const currentInputs = {};
|
||||
for (const key in DEFAULTS) {
|
||||
currentInputs[key] = Object.prototype.hasOwnProperty.call(
|
||||
props.options,
|
||||
key,
|
||||
)
|
||||
const value = Object.prototype.hasOwnProperty.call(props.options, key)
|
||||
? props.options[key]
|
||||
: DEFAULTS[key];
|
||||
currentInputs[key] =
|
||||
typeof DEFAULTS[key] === 'boolean' ? toBoolean(value) : value;
|
||||
}
|
||||
setInputs(currentInputs);
|
||||
setInputsRow(structuredClone(currentInputs));
|
||||
|
||||
Reference in New Issue
Block a user