<img :src="avatorSrc" alt=""> <img :src="avatorSrc2" alt="">
data:function(){ return { avatorSrc:"https://p.ssl.qhimg.com/dmsmty/74_100_100/t01073ee43c0b8459e4.webp", avatorSrc2:require("../../assets/avator.png"),//图片在本地 } }
2.代码中实现路由跳转
<el-menu-item index="1-1" @click="goRouter(‘/workbench/Needs‘)">needs</el-menu-item> <el-menu-item index="1-2" @click="goRouter(‘/workbench/Risk‘)">risk</el-menu-item> // 路由跳转 Vue.prototype.goRouter = function(path){ this.$router.push(path); }
原文:https://www.cnblogs.com/jlyuan/p/11706088.html