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

taro4 custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar #16678

Open
sixiTr opened this issue Oct 11, 2024 · 14 comments

Comments

@sixiTr
Copy link

sixiTr commented Oct 11, 2024

相关平台

微信小程序

复现仓库

https://github.com/sixiTr/tar-4.0.6.git
小程序基础库: 3.6.0
使用框架: Vue 3

复现步骤

vue3
taro4.0.6
app.config.ts 中的tabBar设置custom:true
src下新建custom-tab-bar 编译后dist目录下没有custom-tab-bar

期望结果

dist下正常编译出custom-tab-bar

实际结果

dist下没有编译出custom-tab-bar

环境信息

 Taro v4.0.6


  Taro CLI 4.0.6 environment info:
    System:
      OS: macOS 15.0.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
      npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.6 => 4.0.6
      @tarojs/components: 4.0.6 => 4.0.6
      @tarojs/helper: 4.0.6 => 4.0.6
      @tarojs/plugin-framework-vue3: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-alipay: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-h5: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-jd: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-qq: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-swan: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-tt: 4.0.6 => 4.0.6
      @tarojs/plugin-platform-weapp: 4.0.6 => 4.0.6
      @tarojs/runtime: 4.0.6 => 4.0.6
      @tarojs/shared: 4.0.6 => 4.0.6
      @tarojs/taro: 4.0.6 => 4.0.6
      @tarojs/vite-runner: 4.0.6 => 4.0.6
      babel-preset-taro: 4.0.6 => 4.0.6
      eslint-config-taro: 4.0.6 => 4.0.6
@sixiTr sixiTr changed the title 4.0.6 custom-tab-bar编译后dist文件下没有 无法正常编译 4.0.6 custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar Oct 11, 2024
@sixiTr sixiTr changed the title 4.0.6 custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar Oct 11, 2024
@sixiTr sixiTr changed the title custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar taro4 custom-tab-bar无法正常编译 微信小程序编译后dist文件下没有custom-tab-bar Oct 12, 2024
This was referenced Oct 12, 2024
@sixiTr
Copy link
Author

sixiTr commented Oct 14, 2024

补充一下 vite编译

@yangjiang3973
Copy link

yangjiang3973 commented Oct 16, 2024

+1 我也一样遇到了这个问题,我使用的是react。

@sixiTr
Copy link
Author

sixiTr commented Oct 17, 2024

+1 我也一样遇到了这个问题,我使用的是react。

目前先降为3.6使用了,希望官方早日解决一下,还是想用4的vite的

@yangjiang3973
Copy link

+1 我也一样遇到了这个问题,我使用的是react。

目前先降为3.6使用了,希望官方早日解决一下,还是想用4的vite的

我因为页面少,就没有继续用自带的custom-tab了。直接自己重新写个nav component,每个页面手动在最下面导入一下。也就几次的事情。vite还是要用的哈哈。

@en-o
Copy link

en-o commented Nov 7, 2024

我Taro v3.6.33也没有

@ahjsrhj
Copy link

ahjsrhj commented Nov 14, 2024

有同样的问题, taro4 + react + vite

@rxxy
Copy link

rxxy commented Nov 17, 2024

taro4 + vue3 + vite
+1

@nnecec
Copy link

nnecec commented Nov 22, 2024

同样的问题 taro4 + react + vite

@laine001
Copy link

laine001 commented Nov 23, 2024

+1!

@en-o
Copy link

en-o commented Nov 26, 2024

我Taro v3.6.33也没有

  • 我说下我怎能可以的: 在文件app.config.ts里添加defineAppConfig#tabBar
  • 同时在custom-tab-bar目录里也要写内容
  • 即 两个缺一不可才会生效(真尼玛狗设计

@rxxy
Copy link

rxxy commented Nov 30, 2024

  • defineAppConfig

这是微信的设计,和taro没关系,后面升级估计就可以 不用写,关键taro4是写了也没用
image

@fanyinghao
Copy link

同样的问题, taro4 + react + vite

想着用原生写的custom-tab-bar的内容,手动拷贝到了dist。可是会遇到点击切换tab没实时更新选中的问题,解决方式Taro是在对应tab页面加载时,获取tabbar对象进行setData。

但目前使用Taro.getTabBar方法获取不到tabbar对象,尝试多种方式也无效(包括getCurrentPages,getCurrentInstance等),依旧无法获取到tabbar对象。

@Wzb3422
Copy link

Wzb3422 commented Jan 12, 2025

同样的问题

@zhiwenchen
Copy link

实测, 使用vite会有这个问题, 创建项目的时候使用webpack能正常显示

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants