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 String Replace Hash(#) with Space</h3> <p>{{text}}</p> <p>{{ modifiedText }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { text: "Hello#world#foo#bar", modifiedText: "", }; }, mounted() { this.modifiedText = this.text.replaceAll("#", " "); }, }); </script> <style scoped> #app { font-family: Arial, sans-serif; width: 80%; margin: 0 auto; } h3 { font-size: 1.5rem; font-weight: bold; color: #333; } p { font-size: 1rem; line-height: 1.5; color: #666; } /* Style the second paragraph differently */ p:nth-of-type(2) { color: #ff6600; } </style> </body> </html>