前端项目实战叁佰玖拾肆react-admin和material ui-react-hook-form 使用

 <Edit resource={resource} id={id}>
      <SimpleForm toolbar={false}>
        <Stack direction={'row'}>
          <TextInput variant='outlined' sx={{ mr: 1 }} source='step_no' label='编号' />
          <TextInput variant='outlined' sx={{ mr: 1 }} source='stand_time' label='工时' />
          <TextInput variant='outlined' sx={{ mr: 1 }} source='stand_price' label='工价' />
          <TextInput variant='outlined' sx={{ mr: 1 }} source='step_desc' label='说明' />
        </Stack>
        <SaveButton sx={{ height: "36px", mt: '9px', mj: 2 }}
          type='button' mutationOptions={{
            onSuccess: () => {
              redirect(false)
              // if(expand){
              //   toggleExpanded()
              // }
            }
          }}
        >
        </SaveButton>
      </SimpleForm>
    </Edit>

重置按钮

posted @ 2023-09-08 08:50  前端导师歌谣  阅读(6)  评论(0)    收藏  举报  来源