screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <h3>Vue Js Genrerate Password All Character</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 result = ""; let characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;':\"<>,.?/\\"; let charactersLength = characters.length; for (let i = 0; i < 20; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } this.password = result; } } }) </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>