screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js Select Input Text on Focus</h3> <label for="myInput">Input:</label> <input id="myInput" v-model="inputValue" @focus="selectInput"> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { inputValue: 'FontAwesomeicons.com' } }, methods: { selectInput(event) { event.target.setSelectionRange(0, event.target.value.length) } } }); </script> <style scoped> #app { margin: 20px; padding: 20px; border: 1px solid black; } label { font-weight: bold; } input:focus { border-color: blue; outline: none; } </style> </body> </html>