0
点赞
收藏
分享

微信扫一扫

C# WPF入门学习主线篇(十五)—— DockPanel布局容器

_刘彦辉 2024-06-10 阅读 31

错误写法:

main.js

Vue.prototype.$imgUrl = '图片地址'

这么写之后 就发现压根不起作用;获取到的是undefined

正确写法:

返回函数,后面可以拼上OSS图片完整路径

Vue.prototype.$imgUrl = (url) => {
  return ("https://地址" + url);
};

页面使用:

template

<image :src="$imgUrl('/list-icon.png')" />

js

this.$imgUrl('/list-icon.png')

css定义

uni.scss

$imgUrl: "https://图片地址";

style使用:

background: url($imgUrl + "/modal.png") no-repeat;
举报

相关推荐

0 条评论