文件中的本地资源图片无法通过 WXSS 获取,可以使用网络图片,或者 base64,或者使用image标签

1、错误描述

VM3930:1 pages/def/def.wxss 中的本地资源图片无法通过 WXSS 获取,可以使用网络图片,或者 base64,或者使用<image/>标签。请参考文档:https://developers.weixin.qq.com/miniprogram/dev/qa.html#%E6%9C%AC%E5%9C%B0%E8%B5%84%E6%BA%90%E6%97%A0%E6%B3%95%E9%80%9A%E8%BF%87-wxss-%E8%8E%B7%E5%8F%96
  1 | .nav{
  2 |   background: url('../../images/header-bg.png')
> 3 | }
    |  ^
  4 | 
  5 | .nav .cu-item{
  6 |   margin: 0 20rpx;

2、错误描述

      def.wxss

.nav{
  background: url('../../images/header-bg.png')
}

.nav .cu-item{
  margin: 0 20rpx;
  padding: 0 30rpx;
}

.cu-item{
   160rpx;
}

    def.wxml

<scroll-view scroll-x class="bg-green nav text-center">
  <view class="cu-item {{0==TabCur?'text-white cur':''}}" bindtap="tabSelect" data-id="0">
    <text class="cuIcon-camerafill"></text>A
  </view>
  <view class="cu-item {{1==TabCur?'text-white cur':''}}" bindtap="tabSelect" data-id="1">
    <text class="cuIcon-upstagefill"></text>B
  </view>
  <view class="cu-item {{2==TabCur?'text-white cur':''}}" bindtap="tabSelect" data-id="2">
    <text class="cuIcon-clothesfill"></text>C
  </view>
</scroll-view>

3、解决办法

原文地址:https://www.cnblogs.com/hzcya1995/p/13313694.html