File tree Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Expand file tree Collapse file tree 3 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,14 @@ yarn add @astro-utils/forms
53
53
Edit your ` astro.config.ts ` to add the integration
54
54
``` ts
55
55
import { defineConfig } from ' astro/config' ;
56
- import formsDebug from " @astro-utils/forms/dist/integration.js" ;
56
+ import formDebug from " @astro-utils/forms/dist/integration.js" ;
57
57
58
58
export default defineConfig ({
59
59
output: ' server' ,
60
- integrations: [formsDebug ]
60
+ integrations: [formDebug ]
61
61
});
62
62
```
63
- This integration will easy you debugging by avoiding the browser popups every vite reload.
63
+ This integration will easy you're debugging by avoiding the browser popups every vite reload.
64
64
65
65
66
66
Edit
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ It includes the following attributes:
24
24
- ** props** - props for the ` as ` element
25
25
26
26
``` astro
27
- <BInput type="date" name="meetingDate" min="2023-2-2" max"2023-4-2" required/>
27
+ <BInput type="date" name="meetingDate" min="2023-2-2" max= "2023-4-2" required/>
28
28
```
29
29
30
30
### BTextarea
@@ -72,7 +72,8 @@ The select option
72
72
```
73
73
74
74
## Form controls
75
- ` BButton ` is the general form control. You can also use it without ` BindForm ` component
75
+ ` BButton ` is the general form control. You can also use it without ` Bind ` data.
76
+
76
77
Attributes:
77
78
- ** onClick** - function to execute when the button clicked
78
79
- ** connectId** - (optional) name for the button action (auto-generate by default)
@@ -84,11 +85,10 @@ function sayHi(){
84
85
console.log('Hi');
85
86
}
86
87
---
87
- <BButton onClick={sayHi}>Say Hi</BButton>
88
-
88
+ <BindForm>
89
+ <BButton onClick={sayHi}>Say Hi</BButton>
90
+ <BindForm/>
89
91
```
90
- ### Note
91
- If you want the the button click will effect on JSX that appears before the button, it must be inside a ` BindForm `
92
92
93
93
## Form Error
94
94
Original file line number Diff line number Diff line change @@ -13,17 +13,18 @@ Use can get the session with the activation of web forms
13
13
14
14
``` astro
15
15
---
16
- import { BButton } from "@astro-utils/forms/forms.js";
16
+ import { BindForm, BButton } from "@astro-utils/forms/forms.js";
17
17
const { session } = Astro.locals;
18
18
19
19
function increase() {
20
20
session.counter ??= 0;
21
21
session.counter++;
22
22
}
23
23
---
24
-
25
- <BButton onClick={increase}>++</BButton>
26
- <p>Current counter: {amSession.counter}</p>
24
+ <BindForm>
25
+ <p>Current counter: {session.counter}</p>
26
+ <BButton onClick={increase}>++</BButton>
27
+ </BindForm>
27
28
```
28
29
29
30
### Configuration
You can’t perform that action at this time.
0 commit comments