!DOCTYPE html
html
head
title'v-bind' Image Source Exampletitle
style
#app {
border dashed black 1px;
width 250px;
padding 0 10px 10px 10px;
}
img {
width 100%;
}
style
head
body
h1'v-bind' Image Source Exampleh1
div id=app
pThe browser finds the 'src' attribute value from the Vue instance with the use of 'v-bind'.p
img v-bindsrc=url
div
script src=httpsunpkg.comvue@3distvue.global.jsscript
script
const app = Vue.createApp({
data() {
return {
url mediawaikiki_beach.jpg
Der Pfad hier zum Ordner media ist relativ
url httpsspaces.w3schools.comspacedemirvhmediacocohead_rail2.jpg
Es geht auch mit dem absoluten Pfad
}
}
})
app.mount('#app')
script
body
html