2***@qq.com
2***@qq.com
  • 发布:2022-01-26 15:20
  • 更新:2022-01-26 15:30
  • 阅读:328

uniapp vue3样式不可以这样写吗?

分类:uni-app

比如背景图
static->scss->mixin.scss

@mixin bgImg($w: 0, $h: 0, $img: '', $size: 100% 100%) {
width: $w;
height: $h;
background: url($img) no-repeat;
background-size: $size;
}
在uni.scss引入
@import '@/static/scss/mixin.scss';
在page->index->index.vue使用
<style lang="scss" scoped>
.container{
@include bgImg(100%, 150rpx, "../../static/images/tourist/top.png");
}
</style>
报错附近第二张

2022-01-26 15:20 负责人:无 分享
已邀请:
不会飞的羊

不会飞的羊

明显是图片路径问题,使用@替换

该问题目前已经被锁定, 无法添加新回复