后续会补充
1.require引入
src -> asstes
<template>
<img :src="url">
</template>
<script>
export default {
name: 'App',
data(){
return{
url: require("./assets/logo.png"),
}
}
}
</script>
2.import引入
src -> asstes
<template>
<img :src="url">
</template>
<script>
import URL from "./assets/logo.png";
export default {
name: 'App',
data(){
return{
url: URL,
}
}
}
</script>
3.public引入
public -> img
<template>
<img :src="url">
</template>
<script>
export default {
name: 'App',
data(){
return{
url: "img/logo.png",
}
}
}
</script>