1.0.4 • Published 7 months ago

@craydel/craydel-password-field v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

CraydelPasswordField

Installation

Get the latest version by NPM:

$ npm i @craydel/craydel-password-field

Register Plugin

If you use the plugin API, the component will be registered as a global component just like when including it with the script tag, but you won't need to re-register it through the components property in your own components.

Create the plugin file e.g craydel-components.js file.

// craydel-components.js
import Vue from 'vue'
import CraydelPasswordField from '@craydel/craydel-password-field/src/CraydelPasswordField.vue'

const Components = {
  CraydelPasswordField,
};

Object.keys(Components).forEach(name => {
  Vue.component(name, Components[name]);
});

export default Components;

Next reference the plugin file in your nuxt.config.js

// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
  '~/plugins/craydel-components.js'
]

Props

NameTypeDefaultDescription
idstringrandom IDSets the DOM id on the component.
placeholderstring'Enter password'Sets the component's placeholder text.
placeholder-confirmstring'Enter password'Sets the component's confirm password placeholder text.
is-requiredbooleanfalsePuts component in a required state.
required-errorstring'Field is required'Puts the component in an error state and passes through the custom required error message.
confirm-required-errorstring'Field is required'Puts the component in an error state and passes through the custom required error message for the confirm password field.
confirm-error-messagestring'Passwords must match'Puts the component in an error state and passes through the custom error message when password and confirm password fields do not match.
max-lengthnumber100The maximum number of characters allowed in the field.
show-password-strengthbooleanfalseDisplays a password strength meter and a defined set of rules.
show-confirm-fieldbooleanfalseDisplays the confirm password field.
hintstringundefinedHint text.
no-validationbooleanfalseRemoves the validation styling from the component.

Usage

An example showing a password field that shows a password strength meter and a confirm password field.

<craydel-password-field show-confirm-field show-password-strength></craydel-password-field>
1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

8 months ago