fwh1990
fwh1990
研究了一个新方案: copy配置 + 全局的一次性usingComponents,但是需要等到`[email protected]`发布,因为根据这个issue( https://github.com/NervJS/taro/issues/7098 ),全局usingComponents还有问题
还有一种就是继续使用组件内的config:https://github.com/NervJS/taro/issues/5477#issuecomment-586804592 ,但是这个官方还没具体的实现计划
https://github.com/NervJS/taro/issues/7098 这个issue又被重置到3.0.8了,尬聊!!
@mitayou @zhiyu 不需要这么做,我已经在做Taro的插件(Plugin)了。到时候组件写法还是和2.x时一样。而usingComponents将变成这样 ```typescript export { useIconfont } from '../../components/iconfont/helper'; export default { usingComponents: { iconfont: useIconfont(), } } ``` 插件有一个功能 https://github.com/NervJS/taro/issues/7274 暂时失效,当这个issue修复时,我们将不再需要写`usingComponents`了。 我昨晚才想到这个方案,做了2/3,今晚应该可以发布next
Hello, `taro-iconfont-cli@next`已经发布,欢迎使用,唯一需要变更的就是usingComponent ```typescript // pages/**/index.config.js import { useIconFont } from '../../components/iconfont/helper'; export default { usingComponents: Object.assign(useIconFont()), } ``` 不算最好的方案,所以正式版先不发布。有什么更好的建议,欢迎随时反馈
> > Hello, `taro-iconfont-cli@next`已经发布,欢迎使用,唯一需要变更的就是usingComponent > > ```ts > > // pages/**/index.config.js > > > > import { useIconFont } from '../../components/iconfont/helper'; > > > > export default { > >...
> 7098的bug解决了 坐等更新3.0.8 这样不用每个页面都写usingComponents了 多谢大佬提供这么好的项目 昨晚亲测有效。已经做好PR https://github.com/iconfont-cli/taro-iconfont-cli/pull/32/files ,坐等Taro 3.0.8
已经发布 3.0.0 正式版,邀请各位安装尝试。任何问题及时反馈,谢谢
> 貌似 无法显示图标 我是按照文档的步骤一步一步操作的 但是字体图标没显示 也没有报错 不知道错误出在了哪里 需要升级到3.0.8呢,请确认一下你的taro版本
> 升级3.0以后,按照上面的写法,页面会报元素不存在,请检查你的代码。已经在app.config.js中配置了usingComponents。taro也升级到了3.0.8。编译的是支付宝小程序,貌似这种写法不适合支付宝小程序吧 https://github.com/NervJS/taro/issues/5778 服了taro3 @179778978