screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <h3>Generating Secure Passwords in Vue.js Using Only Number </h3> <div id="app"> <input type="text" v-model="password" /> <button @click="generatePassword">Generate Password</button> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { password: "" }; }, methods: { generatePassword() { let characters = '123456789'; let password = ''; let length = 20; for (let i = 0; i < length; i++) { password += characters.charAt(Math.floor(Math.random() * characters.length)); } this.password = password; } } }) </script> <style> input[type="text"] { width: 250px; height: 40px; font-size: 16px; padding: 10px; } button { height: 40px; font-size: 16px; cursor: pointer; } </style> </body> </html>