Skip to content

Commit 8905e0a

Browse files
committed
release: v1.2
1 parent 48800d3 commit 8905e0a

File tree

5 files changed

+32
-74
lines changed

5 files changed

+32
-74
lines changed

docs/guide/debug/devTools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import `@autostorejs/devtools`
4242
```tsx {12-13}
4343
import { createStore,computed } from '@autostorejs/react';
4444
import { Button,ColorBlock } from "x-react-components"
45-
const { state,useState,$ } = createStore({
45+
const { state,$ } = createStore({
4646
firstName:"Zhang",
4747
lastName:"Fisher",
4848
age:18,

docs/guide/form/form/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const { Form } = useForm({
5757
</Form>
5858
```
5959

60-
更多的`Field`组件的用法请参考[Field组件](/guide/form/field/component.md)
60+
更多的`Field`组件的用法请参考[Field组件](/guide/form/field/field-component.md)
6161

6262
### 第4步:提交表单
6363

docs/guide/form/form/validate.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

docs/guide/intro/get-started.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,29 @@ const store = createStore({
212212
`AutoStore`提供了非常强大的表单双向绑定能力,详见[表单绑定](/guide/form/about)查看更多内容.
213213
:::
214214

215+
## 第7步: 调试与诊断
216+
217+
在开发与调试过程中,`AutoStore`支持使用[Redux DevTools Extension](https://github.com/reduxjs/redux-devtools)来调试`AutoStore`的状态。
218+
219+
只需要在你的项目的最开始处导入`@autostorejs/devtools`,然后配置`{debug:true}`即可。
220+
221+
```ts {3,6}
222+
//main.ts | app.ts | index.ts
223+
224+
import `@autostorejs/devtools`
225+
226+
// 创建store时,配置debug:true
227+
const store = createStore({...},{
228+
debug:true,
229+
id:"user" // 配置id便以在devTools中显示
230+
})
231+
232+
```
233+
234+
使用效果如下:
235+
236+
![devTools](../debug/devtools.png)
237+
215238
216239
## 小结
217240

packages/components/src/Input.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ const InputStyle = styled<InputProps>({
8585
})
8686

8787
export const Input:ReactFC<InputProps> = (props:InputProps)=>{
88-
const { id=Math.random().toString(36).slice(2), enable = true, style={},value, actions,...restProps } = props;
88+
const { id=Math.random().toString(36).slice(2), enable = true, style={},value, actions,validate,...restProps } = props;
8989
const label = props.label || props.name || props.id
9090
const ref = useRef<HTMLInputElement>(null)
91-
Object.entries(restProps).forEach(([key,value])=>{
92-
if(typeof(value)==='boolean'){
93-
// @ts-ignore
94-
restProps[key] = value ? "true" : "false"
95-
}
96-
})
91+
// Object.entries(restProps).forEach(([key,value])=>{
92+
// if(typeof(value)==='boolean'){
93+
// // @ts-ignore
94+
// restProps[key] = value ? "true" : "false"
95+
// }
96+
// })
9797
return (
9898
<div
9999
className={InputStyle.className}

0 commit comments

Comments
 (0)