This is a simple password generator component in VueJS.
- Copy the
passwordGenerator.vue
file into your project'ssrc/components
directory. - Import the
passwordGenerator
component in VueJS fromsrc/components/passwordGenerator.vue
.
import passwordGenerator from './components/passwordGenerator.vue'
- Use the component in your Vue instance or component.
new Vue({
el: '#app',
components: {
'password-generator': passwordGenerator
},
});
<password-generator></password-generator>
Once the button is clicked, a new 10-character password is visually created. You can further customize this by changing the length and charset variables in the generatePassword
function.