运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <title>'v-bind' Image Source Example</title> <style> #app { border: dashed black 1px; width: 250px; padding: 0 10px 10px 10px; } img { width: 100%; } </style> </head> <body> <h1>'v-bind' Image Source Example</h1> <div id="app"> <p>The browser finds the 'src' attribute value from the Vue instance with the use of 'v-bind'.</p> <img v-bind:src="url"> </div> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script> const app = Vue.createApp({ data() { return { url: "img_beach3.jpg" } } }) app.mount('#app') </script> </body> </html>