iconfont-cli / taro-iconfont-cli

在Taro框架中使用iconfont图标,支持多端,支持多色彩,不依赖字体。
MIT License
344 stars 49 forks source link

Taro3,支付宝小程序,图标不显示 #43

Open hight-lig opened 3 years ago

hight-lig commented 3 years ago

按照readme书写的方式如 支付宝小程序ide提示元素不存在,

fwh1990 commented 3 years ago

https://github.com/NervJS/taro/issues/5778#issuecomment-716378137

hight-lig commented 3 years ago

NervJS / taro#5778(评论)

意思是支付宝小程序不支持是吗?

fwh1990 commented 3 years ago

Taro 3.0太多人抱怨了,问题很多,现在就是因为官方本身不支持造成的。issue里作者说了,3.1会修复这个问题。

pandajk commented 3 years ago

现在3.2了修复了吗🙃

Jackyzm commented 3 years ago

我升级到3.1.4了 组件正常出来了 bgImage 也能在开发工具中看到 但是还是没有出现图标

zhejilifang commented 2 years ago

Taro 3.0太多人抱怨了,问题很多,现在就是因为官方本身不支持造成的。issue里作者说了,3.1会修复这个问题。

现在3.2了修复了吗🙃

这个问题一直到最新版的taro依旧没有修复,只能自己手动在使用iconfont组件的页面级别config.js下 添加配置 usingComponents, taro官方并没有修复这个问题

Link-X commented 2 years ago

在要使用的页面加入usingComponents 可行

// pages/home/index.config.ts
export default {
  navigationBarTitleText: '首页',
  enableShareAppMessage: true,
  usingComponents: { // 主要是个
    iconfont: `../../components/iconfont/${process.env.TARO_ENV}/${process.env.TARO_ENV}`
  }
}
我的版本是   
"taro": "3.4.10"
"taro-iconfont-cli": "3.3.0",