add docs
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# AuthorizeForm 授权表单
|
||||
|
||||
登录与注册合一的授权表单,验证码、请求与回调全部由外部注入。
|
||||
|
||||
## 基础用法
|
||||
|
||||
:::preview 基础用法 || 演示用验证码由内联 SVG 生成,提交函数为模拟实现
|
||||
|
||||
demo-preview=../demos/authorize-form/basic.vue
|
||||
|
||||
:::
|
||||
|
||||
## 何时使用
|
||||
|
||||
需要登录与注册并排在一个面板里切换时使用。组件不发起任何请求,也不保存登录态,全部通过回调交由业务层处理。
|
||||
|
||||
## 注入能力
|
||||
|
||||
| 属性 | 说明 |
|
||||
| --- | --- |
|
||||
| `captcha` | 拉取验证码,返回 `{ id, data }`,`data` 会直接作为图片地址使用。 |
|
||||
| `login` | 提交登录,入参含验证码与表单数据。 |
|
||||
| `register` | 提交注册,入参同上。 |
|
||||
|
||||
表单内部只在请求成功后抛出 `loginSuccess` 或 `registerSuccess`,跳转、写入 token 等动作由外层完成。
|
||||
|
||||
## API
|
||||
|
||||
<api-table name="AuthorizeForm" />
|
||||
Reference in New Issue
Block a user