screen_rotation
Copied to Clipboard
<html> <head> <meta charset="UTF-8"> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js String Replace Slash with Space</h3> <p>{{ text }}</p> <p>{{ replacedText }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { text: "This/is/a/test", }; }, computed: { replacedText() { return this.text.replace(/\//g, " "); }, }, }); </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>