Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

iconfont引入到uniapp中,部分图标变成了跟原本毫无关系的图标?

iconfont引入到uniapp中,部分图标变成了跟原本毫无关系的图标?

尝试过使用 Unicode 方式引入,修改过图标的 class,问题依然存在

相关代码

<uni-grid :column="3">
    <uni-grid-item v-for="(btn, i) of btns" :key="i" :index="i">
      <view class="grid-item-box">
        <text class="iconfont" :class="btn.iconClass"></text>
        <view>{{ btn.text }}</view>
      </view>
    </uni-grid-item>
</uni-grid>

export default {
    data() {
      return {
        btns: [{
          text: "入库记录",
          iconClass: "icon-rukujilu1"
        }, {
          text: "出库记录",
          iconClass: "icon-chukujilu1"
        }, {
          text: "盘点记录",
          iconClass: "icon-pandianjilu1"
        }, {
          text: "保养记录",
          iconClass: "icon-baoyangjilu1"
        }, {
          text: "维修记录",
          iconClass: "icon-weixiujilu4"
        }, {
          text: "报废记录",
          iconClass: "icon-baofeijilu"
        }]
      }
    }
  }

上面一共六个图标,除了保养记录,其余的图标都是正确的。而保养记录原本在iconfont网站是这个样子(期望的样子):

image.png

然而在项目里是这个样子:
image.png

百思不得其解,求各路大神来显灵。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

有一个可能是字体图标的font-family重复了,可以换一个,不要起iconfont这个名字。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...