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

微信小程序支持自定义 tabbar 了,Taro是否也要支持下? #2011

Closed
joyran opened this issue Jan 22, 2019 · 14 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@joyran
Copy link

joyran commented Jan 22, 2019

微信小程序目前已经支持自定义 tabbar 组件了,但是需要在根目录下添加下面四个文件

custom-tab-bar/index.js
custom-tab-bar/index.json
custom-tab-bar/index.wxml
custom-tab-bar/index.wxss

我在src根目录新建 custom-tab-bar 文件夹,并新增index.js和index.less文件,但是并没有编译,这个需要怎么处理?

https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html

@taro-bot
Copy link

taro-bot bot commented Jan 22, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam luckyadam added enhancement New feature or request CLI labels Jan 22, 2019
@taro-bot
Copy link

taro-bot bot commented Jan 22, 2019

CC @luckyadam

@luckyadam
Copy link
Member

近期会支持到

@wugy0103
Copy link

同求

@javahuang
Copy link

@gclsoft
Copy link

gclsoft commented Apr 9, 2019

这个要如何使用, 有没例子? 我只设置了custome:true编译会报错:

编译  组件文件  src/custom-tab-bar
(node:367032) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'pages' of undefined
    at buildPages (C:\Users\gz000069\AppData\Roaming\npm\node_modules\@tarojs\cli\src\weapp.js:1190:27)
    at Object.build (C:\Users\gz000069\AppData\Roaming\npm\node_modules\@tarojs\cli\src\weapp.js:2217:9)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
(node:367032) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:367032) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{ Error: ENOENT: no such file or directory, open 'C:\Users\Documents\WeChat Files\fhjjvfdff\Files\taroConverte\src\custom-tab-bar'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at buildSingleComponent (C:\Users\gz000069\AppData\Roaming\npm\node_modules\@tarojs\cli\src\weapp.js:1737:31)
    at buildCustomTabbar (C:\Users\gz000069\AppData\Roaming\npm\node_modules\@tarojs\cli\src\weapp.js:1090:9)
    at buildEntry (C:\Users\gz000069\AppData\Roaming\npm\node_modules\@tarojs\cli\src\weapp.js:1137:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\Documents\\WeChat Files\\fhjjvfdff\\Files\\taroConverte\\src\\custom-tab-bar' }
编译  所有页面  

@Chen-jj
Copy link
Contributor

Chen-jj commented Jun 10, 2019

@gclsoft 在 src 目录下新建 custom-tab-bar 目录存放组件即可,app.json 的配置参考微信小程序文档。

image

@archiewx
Copy link

@gclsoft 在 src 目录下新建 custom-tab-bar 目录存放组件即可,app.json 的配置参考微信小程序文档。

image

小哥。你这个方式我试了一下。Taro 报警告了⚠️

image

@archiewx
Copy link

image
这是报错

image
编译的目录

@shenpvip
Copy link

请问hooks写法,在组件里如何拿到自定义tabbar的组件实例呢,如何获取getTabBar

1 similar comment
@eattopking
Copy link

请问hooks写法,在组件里如何拿到自定义tabbar的组件实例呢,如何获取getTabBar

@wellssu0
Copy link

请问hooks写法,在组件里如何拿到自定义tabbar的组件实例呢,如何获取getTabBar

同问

@yjwSurCode
Copy link

请问hooks写法,在组件里如何拿到自定义tabbar的组件实例呢,如何获取getTabBar

同问

@wugy0103
Copy link

wugy0103 commented Aug 30, 2022 via email

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

No branches or pull requests