screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h3>Vue Js Change Image Src | Url Dynamically</h3> <img v-bind:src="imgSrc"style='width: 100%;height:auto;max-height:500px'> <br> <button @click="changeImg">change</button> </div> <script type="module"> import { createApp } from "vue"; createApp({ data() { return { imgSrc:'https://www.sarkarinaukriexams.com/images/post/1673249449chnange_img_src_dynamically_(1).jpg', updateSrc:'https://www.sarkarinaukriexams.com/images/editor/1670265927Capture123243243423.PNG' } }, methods: { changeImg() { this.imgSrc = this.updateSrc } } }).mount("#app"); </script> </body> </head> </html>