Open fanlvwen opened 1 year ago
React Native 不识别自定义的字体名, 是不是并非iconfont问题?
React Native 不识别自定义的字体名, 是不是并非iconfont问题?
iconfont下载下来之后,默认就是这个名字,小程序正常识别的,rn不行
React Native 不识别自定义的字体名, 是不是并非iconfont问题?
主要是不识别font-family
后面这个iconfont
,把它换成任何字符串都是报错的 @yoyo837
换成行业常见的字体名能正常吗?
换成行业常见的字体名能正常吗? 主要是不识别
font-family
后面这个iconfont
,把iconfont
换成任何字符串都是报错的 @yoyo837
相关平台
React Native
使用框架: React
复现步骤
1.正常下载iconfont.scss到项目中 2.app.ts引用iconfont.scss 3.run alipay正常显示,yarn start 运行rn报错 Unexpected token type: div Failed to parse declaration "fontFamily: "iconfont"
期望结果
与小程序同步正常展示iconfont
实际结果
rn端报错无法运行
环境信息
补充信息
iconfont.scss如下 @font-face { font-family: "iconfont"; / Project id 1065077 / src: url('//at.alicdn.com/t/c/font_1065077_btnez6valf.woff2?t=1665563885988') format('woff2'), url('//at.alicdn.com/t/c/font_1065077_btnez6valf.woff?t=1665563885988') format('woff'), url('//at.alicdn.com/t/c/font_1065077_btnez6valf.ttf?t=1665563885988') format('truetype'); }
.iconfont { font-family: "iconfont" !important; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.iconanquan:before { content: "\e8ab"; }