Skip to content

Commit 843431d

Browse files
committed
update README.md
1 parent 14c1f16 commit 843431d

File tree

6 files changed

+454
-52
lines changed

6 files changed

+454
-52
lines changed

README.md

Lines changed: 94 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
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/>
213

314
<p> ⭐️ If it helps you, please give a star.</p>
15+
416
<img src="http://47.104.180.148/go-captcha/go-captcha-v2.jpg" alt="Poster">
517

6-
<br/>
718

819
## Install
920
```shell
@@ -51,18 +62,28 @@ export class AppModule { }
5162

5263
<br/>
5364

54-
## 🖖 Click Mode Captcha
65+
## Click Mode
5566
```angular2html
56-
import GoCaptcha from 'go-captcha-angular';
57-
58-
<GoCaptcha.Click
67+
<go-captcha-click
5968
[config]="{}"
6069
[data]="{}"
6170
[events]="{}"
71+
#domRef
6272
/>
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>
6384
```
6485

65-
### Parameter Reference
86+
6687
```ts
6788
// config = {}
6889
interface ClickConfig {
@@ -90,35 +111,40 @@ interface ClickEvents {
90111
click?: (x: number, y: number) => void;
91112
refresh?: () => void;
92113
close?: () => void;
93-
confirm?: (dots: Array<ClickDot>, reset: ()=>void) => boolean;
114+
confirm?: (dots: Array<ClickDot>, reset:() => void) => boolean;
94115
}
95116

96-
// component method
97-
interface PublicMethods {
117+
// export component method
118+
interface ExportMethods {
98119
reset: () => void,
99120
clear: () => void,
100121
refresh: () => void,
101122
close: () => void,
102123
}
103124
```
104125

105-
## 🖖 Slide Mode Captcha
126+
## Slide Mode
106127
```angular2html
107-
import GoCaptcha from 'go-captcha-angular';
108-
109-
<GoCaptcha.Slide
128+
<go-captcha-slide
110129
[config]="{}"
111130
[data]="{}"
112131
[events]="{}"
132+
#domRef
113133
/>
114134
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>
120145
```
121-
### Parameter Reference
146+
147+
122148
```ts
123149
// config = {}
124150
interface SlideConfig {
@@ -149,18 +175,39 @@ interface SlideEvents {
149175
move?: (x: number, y: number) => void;
150176
refresh?: () => void;
151177
close?: () => void;
152-
confirm?: (point: SlidePoint, reset: () => void) => boolean;
178+
confirm?: (point: SlidePoint, reset:() => void) => boolean;
153179
}
154180

155-
// component method
156-
interface PublicMethods {
181+
// export component method
182+
interface ExportMethods {
157183
reset: () => void,
158184
clear: () => void,
159185
refresh: () => void,
160186
close: () => void,
161187
}
162188
```
163189

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+
164211
```ts
165212
// config = {}
166213
interface SlideRegionConfig {
@@ -191,30 +238,40 @@ interface SlideRegionEvents {
191238
move?: (x: number, y: number) => void;
192239
refresh?: () => void;
193240
close?: () => void;
194-
confirm?: (point: SlideRegionPoint, reset: ()=>void) => boolean;
241+
confirm?: (point: SlideRegionPoint, reset:() => void) => boolean;
195242
}
196243

197-
// component method
198-
interface PublicMethods {
244+
// export component method
245+
interface ExportMethods {
199246
reset: () => void,
200247
clear: () => void,
201248
refresh: () => void,
202249
close: () => void,
203250
}
204251
```
205252

206-
## 🖖 Rotate Mode Captcha
253+
## Rotation Mode
207254
```angular2html
208-
import GoCaptcha from 'go-captcha-angular';
209-
210-
<GoCaptcha.Rotate
255+
<go-captcha-rotate
211256
[config]="{}"
212257
[data]="{}"
213258
[events]="{}"
259+
#domRef
214260
/>
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>
215272
```
216273

217-
### Parameter Reference
274+
218275
```ts
219276
// config = {}
220277
interface RotateConfig {
@@ -242,11 +299,11 @@ interface RotateEvents {
242299
rotate?: (angle: number) => void;
243300
refresh?: () => void;
244301
close?: () => void;
245-
confirm?: (angle: number, reset: ()=>void) => boolean;
302+
confirm?: (angle: number, reset:() => void) => boolean;
246303
}
247304

248-
// component method
249-
interface PublicMethods {
305+
// export component method
306+
interface ExportMethods {
250307
reset: () => void,
251308
clear: () => void,
252309
refresh: () => void,
@@ -255,14 +312,12 @@ interface PublicMethods {
255312
```
256313

257314

258-
## 🖖 Button
315+
## Button
259316
```jsx
260-
import GoCaptcha from 'go-captcha-angular';
261-
262-
<GoCaptcha.Button />
317+
<go-captcha-button />
263318
```
264319

265-
### Parameter Reference
320+
266321
```ts
267322
interface _ {
268323
config?: ButtonConfig;
@@ -279,11 +334,3 @@ export interface ButtonConfig {
279334
horizontalPadding?: number;
280335
}
281336
```
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

Comments
 (0)