错误写法: main.js Vue.prototype.$imgUrl = '图片地址' 这么写之后 就发现压根不起作用;获取到的是undefined 正确写法: 返回函数,后面可以拼上OSS图片完整路径 Vue.prototype.$imgUrl = (url) => {