🚀 See live demo (Pin: 1234 is the right one)
- Simple pincode input field
- Neumorphism styling
- Smooth animations
In your Vue.js project:
npm install @weslink/vue-pincode
<template>
<div id="app">
<div class="container">
<vue-pincode ref="pincodeInput" @pincode="login" />
</div>
</div>
</template>
<script>
import axios from 'axios';
import VuePincode from "./components/VuePincode";
export default {
name: "Login",
components: {
VuePincode
},
methods: {
async login(pincode) {
try {
const { data } = await axios.post(`/login`, { pincode })
this.$refs.pincodeInput.triggerSuccess();
return { success: true, status: data.status }
} catch (e) {
this.$refs.pincodeInput.triggerMiss();
return { success: false, status: e.response.data.status }
}
},
}
};
</script>
Event | Description |
---|---|
pincode | Is triggered when the pincode is four characters long and passes it as parameter |
npm run serve
compiles and hot-reloads demo for developmentnpm run lint
lints and fixes filesnpm run build
compiles and minifies production files and demo
Copyright ©️ 2020 Weslink GmbH, MIT License
Author: Dominik Lenz