1.0.1 • Published 4 years ago
@haironghaha/login-demo v1.0.1
公共登录弹窗 demo
使用说明
此项目依赖 Vue & Sass,使用前请确保已安装这两个依赖包
此项目包含登录注册弹窗及确认弹窗两个组件
确认弹窗组件
此组件入参 title,回调,使用例子如下
// 写法一
this.$LoginAlert('请登录后访问')
.then(() => {
console.log('确定之后的回调')
})
.catch(() => {
console.log('关闭弹窗后的回调')
})
// 写法二
this.$LoginAlert({
title: '请登录后访问'
})
.then(() => {
console.log('确定之后的回调')
})
.catch(() => {
console.log('关闭弹窗后的回调')
})
登录注册弹窗组件
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
currentComponent | String | Login | 当前显示组件,可选值为:Login(登录)Register(注册)SafetyIdentity(安全验证) |
tabs | Array | 'Register', 'Login' | 切换栏显示组件默认注册登录,可以不传 |
tabMapper | object | Register: '注册', Login: '登录',SafetyIdentity: '安全验证' | 组件对应在 tab 栏上显示的名称,若无需修改可以不传 |
onRegistered | Function | null | 注册成功后回调 |
onSigned | Function | null | 登录成功后回调 |
onResetPwd | Function | null | 重置密码后回调 |
使用例子如下
this.$LayerLogin({
currentComponent: current,
onRegistered: res => {
console.log(res)
},
onSigned: res => {
console.log(res)
},
onResetPwd: res => {
console.log(res)
}
})