<template>
<div @click="home">
<img :src="home_url" alt="..." style="height: 10vw">
</div>
</template>
<script>
// 下面是导入两张图片的相对地址
import home_no from '../static/icon/home_no.png'
import home from '../static/icon/home.png'
export default {
name: "newbase",
data () {
return {
home_url: home
}
},
methods: {
home() {
this.home_url = home
}
}
}
</script>
---------------------
作者:haeasringnar
来源:CSDN
原文:https://blog.csdn.net/haeasringnar/article/details/81293020
版权声明:本文为博主原创文章,转载请附上博文链接!
也可以使用imgSrc:require("../../../assets/p3.jpg"),这种方式