Skip to content

Commit

Permalink
chore: update devDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Barrior committed Dec 16, 2024
1 parent ff1d3f9 commit c1716f1
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 203 deletions.
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"cSpell.words": [
"ahooks",
"antd",
"Codecov",
"commitlint",
Expand Down
9 changes: 4 additions & 5 deletions examples/form-render-react/851-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import type {
IFormRenderRef,
} from '@schema-render/form-render-react'
import { Steps, Button } from 'antd'
import { useMemoizedFn } from 'ahooks'

const schema: IFormRenderRootSchema = {
renderType: 'Root',
Expand Down Expand Up @@ -99,7 +98,7 @@ const Demo = () => {
}

// 下一步事件
const handleNext = useMemoizedFn(async () => {
const handleNext = async () => {
// formRenderRef 的 validate 会校验所有表单项
const res = await formRenderRef.current?.validate()
if (res?.hasError || res?.hasWarning) {
Expand All @@ -116,18 +115,18 @@ const Demo = () => {

// 校验通过才进行下一步
setCurrentStep(currentStep + 1)
})
}

// 只重置当前步骤下的表单项数据
const handleReset = useMemoizedFn(() => {
const handleReset = () => {
// 重置数据
setValue({
...value,
[`step${currentStep + 1}`]: {},
})
// 重置错误提示
formRenderRef.current?.resetError()
})
}

const registerActions = useMemo(() => {
return {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@
"@types/react": "^18.0.27",
"@types/react-syntax-highlighter": "^15.5.6",
"@types/testing-library__jest-dom": "^5.14.9",
"ahooks": "^3.7.8",
"antd": "^5.9.0",
"chalk": "^5.2.0",
"classnames": "^2.3.2",
"dayjs": "^1.11.0",
"dumi": "^2.2.7",
"dumi": "^2.4.16",
"execa": "^7.1.1",
"father": "^4.3.8",
"glob": "^10.0.0",
Expand Down
Loading

0 comments on commit c1716f1

Please sign in to comment.