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 Replace Space with Underscore</h3> <label for="userInput">Enter a string:</label> <input id="userInput" v-model="userString"> <p>{{ modifiedString }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { userString: "Replace Space with Underscore", }; }, computed: { modifiedString() { return this.userString.replace(/\s+/g, "_"); }, }, }) </script> <style> #app { max-width: 600px; margin: 0 auto; padding: 20px; background-color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border-radius: 5px; } label { font-size: 1.2rem; font-weight: bold; } input { display: block; width: 100%; padding: 10px; margin-bottom: 20px; font-size: 1.2rem; border: 1px solid #ccc; border-radius: 5px; } p { font-size: 1.2rem; line-height: 1.5; margin-bottom: 20px; } </style> </body> </html>