# AuthLogin
# Introduction
import PressAuthLogin from 'press-plus/press-login-auth/press-login-auth';
export default {
components: {
PressAuthLogin,
}
}
# Code Demo
# Basic usage
<PressAuthLogin
v-if="show"
:after-cancel="afterCancel"
:after-confirm="afterConfirm"
/>
let that;
export default {
data() {
that = this;
return {
show: true,
};
},
methods: {
afterCancel() {
that.onGTip('[afterCancel]');
that.show = false;
},
afterConfirm() {
that.onGTip('[afterConfirm]');
that.show = false;
},
},
};
# Functional call
Currently only supported on H5 side.
import PressAuthLogin from 'press-plus/press-login-auth/press-login-auth';
import { initH5Instance } from 'press-ui/common/component-handler/h5-handler';
let that;
export default {
components: {
PressAuthLogin,
},
data() {
that = this;
return {
};
},
methods: {
showFunctionalDialog() {
initH5Instance(PressAuthLogin, 'press-login-auth', {
isShowByFunction: true,
afterCancel: this.afterCancel,
afterConfirm: this.afterConfirm,
});
},
afterCancel() {
that.onGTip('[afterCancel]');
that.show = false;
},
afterConfirm() {
that.onGTip('[afterConfirm]');
that.show = false;
},
},
};
# API
# Props
| Parameters | Description | Type | Default value |
|---|---|---|---|
| logo | icon | string | https://image-1251917893.file.myqcloud.com/Esports/common/gamers.png |
| tip-desc | Description copy | string | Authorize to log in and get more services |
| btn-text | Button copy | string | Authorized login |
| validate-confirm | Verification method when clicking confirm, returning false will not close | function | - |
| after-cancel | Callback for clicking the close icon | function | - |
| after-confirm | Callback for clicking the confirm button | function | - |
| is-show-by-function | Whether it is a functional call | boolean | false |