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 · 9 comments

Comments

Projects
None yet
7 participants
@joyran
Copy link

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

This comment has been minimized.

Copy link

commented Jan 22, 2019

欢迎提交 Issue~

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

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

Good luck and happy coding~

@taro-bot

This comment has been minimized.

Copy link

commented Jan 22, 2019

@luckyadam

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2019

近期会支持到

@luckyadam luckyadam closed this in 4d77930 Jan 23, 2019

@wugy0103

This comment has been minimized.

Copy link

commented Jan 23, 2019

同求

@javahuang

This comment has been minimized.

Copy link

commented Feb 22, 2019

@gclsoft

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

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

image

@zsirfs

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

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

image

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

image

@zsirfs

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

image
这是报错

image
编译的目录

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.