1
- # Go Captcha Angular Package
1
+ <div align =" center " >
2
+ <img width =" 120 " style =" padding-top : 50px ; margin : 0 ;" src =" http://47.104.180.148/go-captcha/gocaptcha_logo.svg?v=1 " />
3
+ <h1 style =" margin : 0 ; padding : 0 " >Go Captcha</h1 >
4
+ <p >Behavior Captcha For Angular</p >
5
+
6
+ </div >
7
+
8
+ <br />
9
+
10
+ > English | [ 中文] ( README_zh.md )
11
+
12
+ <br />
2
13
3
14
<p > ⭐️ If it helps you, please give a star.</p >
15
+
4
16
<img src =" http://47.104.180.148/go-captcha/go-captcha-v2.jpg " alt =" Poster " >
5
17
6
- <br />
7
18
8
19
## Install
9
20
``` shell
@@ -51,18 +62,28 @@ export class AppModule { }
51
62
52
63
<br />
53
64
54
- ## 🖖 Click Mode Captcha
65
+ ## Click Mode
55
66
``` angular2html
56
- import GoCaptcha from 'go-captcha-angular';
57
-
58
- <GoCaptcha.Click
67
+ <go-captcha-click
59
68
[config]="{}"
60
69
[data]="{}"
61
70
[events]="{}"
71
+ #domRef
62
72
/>
73
+
74
+ <script>
75
+ class Demo {
76
+ // call methods
77
+ @ViewChild('domRef') domRef;
78
+ test(){
79
+ this.domRef?.clear()
80
+ this.domRef?.refresh()
81
+ }
82
+ }
83
+ </script>
63
84
```
64
85
65
- ### Parameter Reference
86
+
66
87
``` ts
67
88
// config = {}
68
89
interface ClickConfig {
@@ -90,35 +111,40 @@ interface ClickEvents {
90
111
click? : (x : number , y : number ) => void ;
91
112
refresh? : () => void ;
92
113
close? : () => void ;
93
- confirm? : (dots : Array <ClickDot >, reset : () => void ) => boolean ;
114
+ confirm? : (dots : Array <ClickDot >, reset : () => void ) => boolean ;
94
115
}
95
116
96
- // component method
97
- interface PublicMethods {
117
+ // export component method
118
+ interface ExportMethods {
98
119
reset: () => void ,
99
120
clear: () => void ,
100
121
refresh: () => void ,
101
122
close: () => void ,
102
123
}
103
124
```
104
125
105
- ## 🖖 Slide Mode Captcha
126
+ ## Slide Mode
106
127
``` angular2html
107
- import GoCaptcha from 'go-captcha-angular';
108
-
109
- <GoCaptcha.Slide
128
+ <go-captcha-slide
110
129
[config]="{}"
111
130
[data]="{}"
112
131
[events]="{}"
132
+ #domRef
113
133
/>
114
134
115
- <GoCaptcha.SlideRegion
116
- [config]="{}"
117
- [data]="{}"
118
- [events]="{}"
119
- />
135
+ <script>
136
+ class Demo {
137
+ // call methods
138
+ @ViewChild('domRef') domRef;
139
+ test(){
140
+ this.domRef?.clear()
141
+ this.domRef?.refresh()
142
+ }
143
+ }
144
+ </script>
120
145
```
121
- ### Parameter Reference
146
+
147
+
122
148
``` ts
123
149
// config = {}
124
150
interface SlideConfig {
@@ -149,18 +175,39 @@ interface SlideEvents {
149
175
move? : (x : number , y : number ) => void ;
150
176
refresh? : () => void ;
151
177
close? : () => void ;
152
- confirm? : (point : SlidePoint , reset : () => void ) => boolean ;
178
+ confirm? : (point : SlidePoint , reset : () => void ) => boolean ;
153
179
}
154
180
155
- // component method
156
- interface PublicMethods {
181
+ // export component method
182
+ interface ExportMethods {
157
183
reset: () => void ,
158
184
clear: () => void ,
159
185
refresh: () => void ,
160
186
close: () => void ,
161
187
}
162
188
```
163
189
190
+ ## Drag-And-Drop Mode
191
+ ``` angular2html
192
+ <go-captcha-slide-region
193
+ [config]="{}"
194
+ [data]="{}"
195
+ [events]="{}"
196
+ #domRef
197
+ />
198
+
199
+ <script>
200
+ class Demo {
201
+ // call methods
202
+ @ViewChild('domRef') domRef;
203
+ test(){
204
+ this.domRef?.clear()
205
+ this.domRef?.refresh()
206
+ }
207
+ }
208
+ </script>
209
+ ```
210
+
164
211
``` ts
165
212
// config = {}
166
213
interface SlideRegionConfig {
@@ -191,30 +238,40 @@ interface SlideRegionEvents {
191
238
move? : (x : number , y : number ) => void ;
192
239
refresh? : () => void ;
193
240
close? : () => void ;
194
- confirm? : (point : SlideRegionPoint , reset : () => void ) => boolean ;
241
+ confirm? : (point : SlideRegionPoint , reset : () => void ) => boolean ;
195
242
}
196
243
197
- // component method
198
- interface PublicMethods {
244
+ // export component method
245
+ interface ExportMethods {
199
246
reset: () => void ,
200
247
clear: () => void ,
201
248
refresh: () => void ,
202
249
close: () => void ,
203
250
}
204
251
```
205
252
206
- ## 🖖 Rotate Mode Captcha
253
+ ## Rotation Mode
207
254
``` angular2html
208
- import GoCaptcha from 'go-captcha-angular';
209
-
210
- <GoCaptcha.Rotate
255
+ <go-captcha-rotate
211
256
[config]="{}"
212
257
[data]="{}"
213
258
[events]="{}"
259
+ #domRef
214
260
/>
261
+
262
+ <script>
263
+ class Demo {
264
+ // call methods
265
+ @ViewChild('domRef') domRef;
266
+ test(){
267
+ this.domRef?.clear()
268
+ this.domRef?.refresh()
269
+ }
270
+ }
271
+ </script>
215
272
```
216
273
217
- ### Parameter Reference
274
+
218
275
``` ts
219
276
// config = {}
220
277
interface RotateConfig {
@@ -242,11 +299,11 @@ interface RotateEvents {
242
299
rotate? : (angle : number ) => void ;
243
300
refresh? : () => void ;
244
301
close? : () => void ;
245
- confirm? : (angle : number , reset : () => void ) => boolean ;
302
+ confirm? : (angle : number , reset : () => void ) => boolean ;
246
303
}
247
304
248
- // component method
249
- interface PublicMethods {
305
+ // export component method
306
+ interface ExportMethods {
250
307
reset: () => void ,
251
308
clear: () => void ,
252
309
refresh: () => void ,
@@ -255,14 +312,12 @@ interface PublicMethods {
255
312
```
256
313
257
314
258
- ## 🖖 Button
315
+ ## Button
259
316
``` jsx
260
- import GoCaptcha from ' go-captcha-angular' ;
261
-
262
- < GoCaptcha .Button / >
317
+ < go- captcha- button / >
263
318
```
264
319
265
- ### Parameter Reference
320
+
266
321
``` ts
267
322
interface _ {
268
323
config? : ButtonConfig ;
@@ -279,11 +334,3 @@ export interface ButtonConfig {
279
334
horizontalPadding? : number ;
280
335
}
281
336
```
282
-
283
- <br />
284
-
285
- ## 👍 Sponsor
286
- <div >
287
- <a href =" http://gocaptcha.wencodes.com/sponsor/ " target =" _blank " >http://gocaptcha.wencodes.com/sponsor/ </a >
288
- </div >
289
- <br />
0 commit comments