screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h2>Vue js replace spaces with dashes</h2> <input v-model="text" /> <p>{{ convertedText }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { text: "Font Awesome icons", }; }, computed: { convertedText() { return this.text.replace(/\s+/g, "-"); }, }, }) </script> <style> #app { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; background-color: #f5f5f5; } h2 { font-size: 2rem; margin-bottom: 1rem; } input { padding: 0.5rem; font-size: 1.2rem; border: 2px solid #ccc; border-radius: 4px; } p { font-size: 1.5rem; margin-top: 1rem; } </style> </body> </html>