Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taro.setTabBarItem中的图片不能被正确的打包 #7769

Closed
yohhhs opened this issue Sep 29, 2020 · 1 comment
Closed

Taro.setTabBarItem中的图片不能被正确的打包 #7769

yohhhs opened this issue Sep 29, 2020 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@yohhhs
Copy link

yohhhs commented Sep 29, 2020

相关平台

微信小程序

小程序基础库: 2.13.0
使用框架: React

复现步骤

Taro.setTabBarItem设置iconPath,编译过后图片不能显示,在dist文件夹中找不到对应的图片,没有被正确的打包

期望结果

图片能被正确的打包

实际结果

图片没有被打包

环境信息

 Taro CLI 3.0.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD


补充信息

编译的时候没有正确识别到图片被引用,打包的时候被忽略掉了

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 29, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Jul 6, 2023

可以配置 copy,手动把可能需要用到的图片加到编译产物中

编译时去扫描此 API 的调用不太可取,因为 iconPath 不一定是字符串,有可能是变量,编译时没有办法准确做出识别。

@Chen-jj Chen-jj closed this as completed Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants