0.1.12 • Published 4 years ago

ramen-login-module v0.1.12

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

ramen-login-module

Vue.js Login Component for ordent/ramenauth backend service.

Installation

npm install ramen-login-module

Usage

  • Import directly on your template
import LoginComponent from 'ramen-login-module'
export default {
	// ...
	components: {
		LoginComponent
	}
	// ...
}
  • Use Nuxt.js plugin
// '/plugin/RamenLoginModule.js'
import Vue from 'vue'
import LoginComponent from 'ramen-login-module';
Vue.use(LoginComponent)

Example Usage

<!-- 'YourPage.vue' -->
<template>
	<LoginComponent
		secretKey="yourSecretKey"
		apiURL="yourURLEndpoint"
		@loginSuccess="actionSuccessLogin"
		@loginError="actionErrorLogin"
		/>
</template>

Options

Property NameTypeDescriptionDefault
apiURLStringrequired; endpoint used for login.none
secretKeyStringrequired; a string-based key to be used later for login.none
iconBooleanshow/hide ALL icon.true
emailTextStringlabel for email inputEmail
passwordTextStringlabel for password inputPassword
buttonTextStringlabel for login buttonLogin
errorTextObjectlabel for error validation (errorEmailFormat, errorEmailRequired, errorPasswordRequired){ errorEmailFormat: 'Wrong email format', errorEmailRequired: 'Email is required', errorPasswordRequired: 'Password is required' }
emailClassStringcustom class that can be added to email inputnone
passwordClassStringcustom class that can be added to password inputnone
buttonClassStringcustom class that can be added to login buttonnone
wrapperClassStringcustom class that overwrites the current default wrapper classlogin-wrapper
inputGroupClassStringcustom class that can be added to input field group(label+input)field

Listeners

Listener NameTypeDescriptionDefault
loginSuccessfunctionhandler function after success login. Default handler is redirect to home page ('/')
loginErrorfunctionhandler function when failed to login. Default handler is doing window.alert the error response

Customize configuration

See Configuration Reference.

License

MIT

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago