screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js Change SVG Color</h3> <svg :fill='selectedColor' xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"> <title>ionicons-v5_logos</title> <polygon points="256 144.03 200.51 47.92 121.08 47.92 256 281.61 390.92 47.92 311.49 47.92 256 144.03" /> <polygon points="409.4 47.92 256 313.61 102.6 47.92 15.74 47.92 256 464.08 496.26 47.92 409.4 47.92" /> </svg> <p>{{selectedColor}}</p> <input type="color" v-model="selectedColor"> </div> <script> new Vue({ el: '#app', data() { return { selectedColor: 'red' }; }, }); </script> <style> #app { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } input[type="color"] { margin-bottom: 20px; width: 100px; height: 40px; border-radius: 20px; border: none; outline: none; cursor: pointer; } polygon { stroke: black; stroke-width: 2; transition: fill 0.3s ease-in-out; } </style> </body> </html>