weui / react-weui Goto Github PK
View Code? Open in Web Editor NEWweui for react
Home Page: https://weui.github.io/react-weui/docs/
weui for react
Home Page: https://weui.github.io/react-weui/docs/
Uploader 组件的 onChange 属性能否同时返回原生的 file 对象,这样感觉灵活性更大一些。
加入
import 'weui';
webpack 启动报错
这一套UI库挺完善的,http://m.sui.taobao.org/components/ 。 如果这些都有了,那么开发一个webapp就很方便了,希望能够在weui也实现,这样将大大方便我们这些微信开发者
vendor.bundle.js是
vendor: ['react', 'classnames', 'react-router', 'react-dom', 'react-addons-css-transition-group']
这些压缩打包的么?
WeUI 的 Demo 中是有 Loading Toast ,但是 React-WeUI 没有,看了一下代码只能传入一个 WeUI ICON ,但是 WeUI Toast 中的 loading 并不是一个标准 ICON 。
ERROR in multi vendor
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example
@ multi vendor
ERROR in .//react-addons-css-transition-group/index.js/react-addons-css-transition-group/index.js 1:17-61
Module not found: Error: Cannot resolve module 'react/lib/ReactCSSTransitionGroup' in E:\demo\weixin\react-weui\node_modules\react-addons-css-transition-group
@ ./
ERROR in .//react-dom/index.js/react-dom/index.js 3:17-46
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in E:\demo\weixin\react-weui\node_modules\react-dom
@ ./
ERROR in ./example/app.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example
@ ./example/app.js 17:13-29
ERROR in .//react-router/lib/Router.js/react-router/lib/Router.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/Link.js/react-router/lib/Link.js 15:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/IndexLink.js/react-router/lib/IndexLink.js 13:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/IndexRedirect.js/react-router/lib/IndexRedirect.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/Redirect.js/react-router/lib/Redirect.js 15:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/IndexRoute.js/react-router/lib/IndexRoute.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/Route.js/react-router/lib/Route.js 15:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/Lifecycle.js/react-router/lib/Lifecycle.js 7:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/RouteContext.js/react-router/lib/RouteContext.js 7:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/RouteUtils.js/react-router/lib/RouteUtils.js 14:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/RoutingContext.js/react-router/lib/RoutingContext.js 17:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in .//react-router/lib/PropTypes.js/react-router/lib/PropTypes.js 6:13-29
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
ERROR in ./example/pages/home/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\home
@ ./example/pages/home/index.js 21:13-29
ERROR in ./example/pages/cell/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\cell
@ ./example/pages/cell/index.js 23:13-29
ERROR in ./example/pages/toast/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\toast
@ ./example/pages/toast/index.js 21:13-29
ERROR in ./example/pages/button/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\button
@ ./example/pages/button/index.js 21:13-29
ERROR in ./example/pages/progress/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\progress
@ ./example/pages/progress/index.js 21:13-29
ERROR in ./example/pages/msg/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\msg
@ ./example/pages/msg/index.js 21:13-29
ERROR in ./example/pages/dialog/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\dialog
@ ./example/pages/dialog/index.js 21:13-29
ERROR in ./example/pages/article/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\article
@ ./example/pages/article/index.js 21:13-29
ERROR in ./example/pages/actionsheet/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\actionsheet
@ ./example/pages/actionsheet/index.js 21:13-29
ERROR in ./example/pages/icons/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\icons
@ ./example/pages/icons/index.js 21:13-29
ERROR in ./example/pages/tab/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\tab
@ ./example/pages/tab/index.js 21:13-29
ERROR in ./example/pages/tab/navbar.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\tab
@ ./example/pages/tab/navbar.js 21:13-29
ERROR in ./example/pages/tab/navbar_auto.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\tab
@ ./example/pages/tab/navbar_auto.js 21:13-29
ERROR in ./example/pages/tab/tabbar.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\tab
@ ./example/pages/tab/tabbar.js 21:13-29
ERROR in ./example/pages/tab/tabbar_auto.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\tab
@ ./example/pages/tab/tabbar_auto.js 21:13-29
ERROR in ./example/pages/panel/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\panel
@ ./example/pages/panel/index.js 21:13-29
ERROR in ./example/pages/searchbar/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\pages\searchbar
@ ./example/pages/searchbar/index.js 21:13-29
ERROR in ./example/component/page.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\example\component
@ ./example/component/page.js 21:13-29
ERROR in ./src/components/icon/index.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\icon
@ ./src/components/icon/index.js 13:13-29
ERROR in ./src/components/button/button.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\button
@ ./src/components/button/button.js 27:13-29
ERROR in ./src/components/form/form_cell.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/form_cell.js 27:13-29
ERROR in ./src/components/button/button_area.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\button
@ ./src/components/button/button_area.js 21:13-29
ERROR in ./src/components/form/textarea.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/textarea.js 27:13-29
ERROR in ./src/components/form/form.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/form.js 27:13-29
ERROR in ./src/components/form/input.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/input.js 27:13-29
ERROR in ./src/components/form/radio.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/radio.js 27:13-29
ERROR in ./src/components/form/switch.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/switch.js 27:13-29
ERROR in ./src/components/form/select.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/select.js 27:13-29
ERROR in ./src/components/label/label.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\label
@ ./src/components/label/label.js 27:13-29
ERROR in ./src/components/form/checkbox.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/checkbox.js 27:13-29
ERROR in ./src/components/mask/mask.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mask
@ ./src/components/mask/mask.js 25:13-29
ERROR in ./src/components/cell/cells.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cells.js 27:13-29
ERROR in ./src/components/form/uploader.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\form
@ ./src/components/form/uploader.js 27:13-29
ERROR in ./src/components/cell/cell.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cell.js 27:13-29
ERROR in ./src/components/cell/cells_title.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cells_title.js 27:13-29
ERROR in ./src/components/cell/cells_tips.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cells_tips.js 27:13-29
ERROR in ./src/components/cell/cell_header.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cell_header.js 27:13-29
ERROR in ./src/components/cell/cell_body.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cell_body.js 27:13-29
ERROR in ./src/components/cell/cell_footer.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\cell
@ ./src/components/cell/cell_footer.js 27:13-29
ERROR in ./src/components/toast/toast.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\toast
@ ./src/components/toast/toast.js 21:13-29
ERROR in ./src/components/actionsheet/actionsheet.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\actionsheet
@ ./src/components/actionsheet/actionsheet.js 27:13-29
ERROR in ./src/components/msg/msg.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\msg
@ ./src/components/msg/msg.js 25:13-29
ERROR in ./src/components/dialog/confirm.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\dialog
@ ./src/components/dialog/confirm.js 25:13-29
ERROR in ./src/components/article/article.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\article
@ ./src/components/article/article.js 27:13-29
ERROR in ./src/components/progress/progress.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\progress
@ ./src/components/progress/progress.js 23:13-29
ERROR in ./src/components/dialog/alert.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\dialog
@ ./src/components/dialog/alert.js 25:13-29
ERROR in ./src/components/icon/icon.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\icon
@ ./src/components/icon/icon.js 29:13-29
ERROR in ./src/components/grid/grid.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\grid
@ ./src/components/grid/grid.js 25:13-29
ERROR in ./src/components/grid/grids.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\grid
@ ./src/components/grid/grids.js 25:13-29
ERROR in ./src/components/grid/grid_icon.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\grid
@ ./src/components/grid/grid_icon.js 25:13-29
ERROR in ./src/components/grid/grid_label.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\grid
@ ./src/components/grid/grid_label.js 25:13-29
ERROR in ./src/components/mediabox/mediabox.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_header.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_header.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_title.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_title.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_body.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_body.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_desc.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_desc.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_info.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_info.js 25:13-29
ERROR in ./src/components/mediabox/mediabox_info_meta.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\mediabox
@ ./src/components/mediabox/mediabox_info_meta.js 25:13-29
ERROR in ./src/components/panel/panel.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\panel
@ ./src/components/panel/panel.js 27:13-29
ERROR in ./src/components/panel/panel_header.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\panel
@ ./src/components/panel/panel_header.js 25:13-29
ERROR in ./src/components/panel/panel_body.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\panel
@ ./src/components/panel/panel_body.js 25:13-29
ERROR in ./src/components/panel/panel_footer.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\panel
@ ./src/components/panel/panel_footer.js 25:13-29
ERROR in ./src/components/tab/tab.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tab.js 25:13-29
ERROR in ./src/components/tab/tab_body.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tab_body.js 25:13-29
ERROR in ./src/components/tab/navbar.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/navbar.js 25:13-29
ERROR in ./src/components/tab/navbar_item.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/navbar_item.js 25:13-29
ERROR in ./src/components/tab/tabbar.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tabbar.js 25:13-29
ERROR in ./src/components/tab/tabbar_item.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tabbar_item.js 25:13-29
ERROR in ./src/components/tab/tabbar_icon.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tabbar_icon.js 25:13-29
ERROR in ./src/components/tab/tabbar_label.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tabbar_label.js 25:13-29
ERROR in ./src/components/tab/tab_body_item.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\tab
@ ./src/components/tab/tab_body_item.js 25:13-29
ERROR in ./src/components/searchbar/searchbar.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\src\components\searchbar
@ ./src/components/searchbar/searchbar.js 23:13-29
现在是直接替代掉原有的className
我看了一下源代码
<div key={idx} {...others} className={className}>{label}</div>
这里唯独排除了className,似乎需要有像 #17 那样的处理
如果使用 react 15.x,使用 Uploader 组件时会报错:
Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
删除 node_modules/react-weui/node_modules/react
之后没有报错了。
当有多个cell用于展示同一类型信息的时候使用cells(如展示个人资料等)。
但是access是在cells上 ,此时又某一cell不需要access,就需要重新使用一个cells,这体验略差
在pc上用chrome和Firefox都是正常的,但是在手机上就出现问题了,用ios和android手机都是无法切换tab,代码如下
<div style={{display: this.state.tab == 0? null : 'none'}}>
<PdController ref="pd"/>
</div>
<div style={{display: this.state.tab == 1? null : 'none'}}>
<ListController />
</div>
</TabBody>
<TabBar>
<TabBarItem
active={this.state.tab == 0}
onClick={this.handleClick.bind(this, 0, "派单")}
icon={<img src={PdCell} />}
label="提交单子"
/>
<TabBarItem
active={this.state.tab == 1}
onClick={(e)=>{this.setState({tab:1});this.mTitle("查看单子")}}
icon={<img src={CheckCell} />}
label="查看单子"
/>
</TabBar>
</Tab>
当我使用 <Button disabled>删除</Button>
时,只能改变样式,但此按钮还是可以触发click
事件的,看了代码发现,disabled属性没有被设置到button
上。
这是故意的,还是一个bug?
https://github.com/dongtong/react_wireless_ui, 刚加了TODOs,希望扩展开来,创建常见的Mobile UI组件。刚入门react,瞎折腾 :), 好像state管理有问题:(
之前 n7 的设计是用 show
属性控制显示, 个人更喜欢之前的设计.
用属性控制显示的好处是属性可以接受 state
或其他 store
传递来的数据.
请问一下这是什么问题?
ERROR in .//react-router/lib/Router.js/react-router/lib/Router.js 23:35-75
Module not found: Error: Cannot resolve module 'history/lib/createHashHistory' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/useRoutes.js/react-router/lib/useRoutes.js 15:25-55
Module not found: Error: Cannot resolve module 'history/lib/Actions' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/useRoutes.js/react-router/lib/useRoutes.js 17:28-61
Module not found: Error: Cannot resolve module 'history/lib/useQueries' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/match.js/react-router/lib/match.js 13:37-79
Module not found: Error: Cannot resolve module 'history/lib/createMemoryHistory' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/match.js/react-router/lib/match.js 17:29-63
Module not found: Error: Cannot resolve module 'history/lib/useBasename' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
webpack: bundle is now VALID.
新增4个组件: Form, FormCell, Input, Label
Form:
FormCell:
Input:
Label:
Discussion:
TODO:
具体code请看 #32
npm update提示: react-weui依赖15.0.1版本出错
现在weui的组件没有一个好的接口与react常用的路由方案(比如react-router)集成。
比如Cell中带props href的时候直接render成
<a href="***"></a>
但是大多数情况下,需要用react-router的Link来渲染,这个有没有什么好的解决方案?
同#23
Navbar:
Searchbar:
类似 #72 这样的问题修改之后,建议即时更新 beta 版本,以便能够基于最新版本开发,不至于出现报错后无法使用的问题。
跑首页的示例是成功的,但新建了一个组件,调用了一下Toast,就编译不过了。
"use strict";
import React from 'react';
import ReactDOM from 'react-dom';
import WeUI from 'react-weui';
import Toast from './components/Toast';
import 'weui';
ReactDOM.render((
<Toast/>
), document.getElementById('container'));
Toast.jsx
import React from 'react';
import {Button, Toast} from 'react-weui';
export default class Toast extends React.Component{
state = {
showToast: false,
showLoading: false,
showCustom: false,
toastTimer: null,
loadingTimer: null,
customTimer: null
};
componentWillUnmount() {
this.state.toastTimer && clearTimeout(this.state.toastTimer);
this.state.loadingTimer && clearTimeout(this.state.loadingTimer);
}
……
ERROR in ./src/js/components/Toast.jsx
Module build failed: SyntaxError: /Users/wuchaoboy/www/webpack_test/src/js/components/Toast.jsx: Unexpected token (5:10)
3 |
4 | export default class Toast extends React.Component{
> 5 | state = {
| ^
6 | showToast: false,
7 | showLoading: false,
8 | showCustom: false,
现在如果使用 react 15.x,使用 Uploader 组件时会报错:
Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
删除 node_modules/react-weui/node_modules/react
之后没有报错了。
是有这个问题吗?只要import了react-weui,不管有没有用到,其它自定义的组件更新都无法热插拔了。
dialog
中 Confirm
和 Alert
的区别似乎只是内容左对齐或居中的样式不同?统一成 Dialog
然后加个 style
参数会更简单么?
有没有计划什么时间更新 tabbar panel 这样的,还是已经更新了,我没找到呀?我看 weui 里早就有这UI的呢
為什麼不用 Stateless Functional Components ?
执行
npm install
npm start
报下面的错误:
ERROR in multi vendor
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/example
@ multi vendor
ERROR in .//react-dom/index.js/react-dom/index.js 3:17-46
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in /Users/xxx/opensource/weui/react-weui/node_modules/react-dom
@ ./
ERROR in .//react-addons-css-transition-group/index.js/react-addons-css-transition-group/index.js 1:17-61
Module not found: Error: Cannot resolve module 'react/lib/ReactCSSTransitionGroup' in /Users/xxx/opensource/weui/react-weui/node_modules/react-addons-css-transition-group
@ ./
ERROR in ./example/app.js
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/example
@ ./example/app.js 17:13-29
ERROR in .//react-router/lib/Router.js/react-router/lib/Router.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/Link.js/react-router/lib/Link.js 15:13-29
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/IndexLink.js/react-router/lib/IndexLink.js 13:13-29
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/IndexRedirect.js/react-router/lib/IndexRedirect.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
ERROR in .//react-router/lib/IndexRoute.js/react-router/lib/IndexRoute.js 19:13-29
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
像Label
是继承 className
的
const { className, children, ...others } = this.props;
const cls = classNames({
weui_label: true,
[className]: className
});
但像CellFooter
之类的,className
归入others
了,会覆盖掉weui
的类。
const {children, ...others} = this.props;
const className = classNames({
weui_cell_ft: true
});
希望统一改成前者,因为我们有时会需要自己加个类来微调下weui
的。感谢!
按照开发文档运行react-weui工程成功之后打开http://localhost:8080这个网址会自动在URL后添加字段如 http://localhost:8080/#/?_k=v98vto ,点击每一个item后添加字段会改变,copy此URL到其他浏览器无法访问网址,请问是什么问题?
按此说明运行项目:
开发
git clone https://github.com/weui/react-weui
cd react-weui
npm install
npm start
报错如下:
[email protected] start /Users/PPfix/Desktop/weui/react-weui
webpack-dev-server --hot --inline --progress --colors --port 8080
70% 2/2 build modulesevents.js:141
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup as oncomplete
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: webpack-dev-server --hot --inline --progress --colors --port 8080
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'webpack-dev-server --hot --inline --progress --colors --port 8080'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-weui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --hot --inline --progress --colors --port 8080
npm ERR! You can get their info via:
npm ERR! npm owner ls react-weui
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/PPfix/Desktop/weui/react-weui/npm-debug.log
望赐教
浏览器/webpack提示无法找到weui module
import React from 'react';
import ReactDOM from 'react-dom';
import WeUI from 'react-weui';
import 'weui';
const {Button} = WeUI;
class App extends React.Component {
render() {
return (
<Button>hello wechat</Button>
);
}
}
ReactDOM.render(
<App/>
), document.getElementById('container'));
这样用webpack打包后的bundle文件有1M多,手机打开需要很长时间,这样根本不能用在实际项目中用啊??
如题
会出react-native版的吗?
在searchbar中输入内容后,点keyboard上的search后,会直接刷新页面,原来的输入的内容会丢失。
看了下代码发现几个问题:
input没有name,导致提交的时候,输入的内容不能通过querystring提交
form没有相关事件,导致没办法prevent默认动作(比如取消keyboard提交事件)。
这个有workround吗?
https://github.com/weui/react-weui/blob/master/docs/actionsheet.md
actionsheet在使用时除了设置state.show为true外,还需要设置actionsheet的state属性active为true(this.refs.actionsheet.state.active = true;)才能正常弹出底部按钮
如题,项目可能会用,谢谢。
/Users/dengka/code/react-weui/node_modules/extract-text-webpack-plugin/index.js:118
Object.keys(b).forEach(function(key) {
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at mergeOptions (/Users/dengka/code/react-weui/node_modules/extract-text-webpack-plugin/index.js:118:9)
at Function.ExtractTextPlugin.extract (/Users/dengka/code/react-weui/node_modules/extract-text-webpack-plugin/index.js:134:29)
at Object. (/Users/dengka/code/react-weui/webpack.config.js:29:43)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at module.exports (/Users/dengka/code/react-weui/node_modules/webpack/bin/convert-argv.js:80:13)
at Object. (/Users/dengka/code/react-weui/node_modules/webpack-dev-server/bin/webpack-dev-server.js:55:48)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
依赖里面没有用到 babel-preset-es2015,我自己加上去还会报错,为何?
我看GITHUB是最新的,
https://www.npmjs.com/package/react-weui 啥时候更新一下?
161 error peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
161 error peerinvalid Peer [email protected] wants react@^0.14.8
161 error peerinvalid Peer [email protected] wants react@^0.14.8
161 error peerinvalid Peer [email protected] wants react@^0.14.8
161 error peerinvalid Peer [email protected] wants [email protected] || 0.14.x
"react": "^0.14.2 || ^15.0.1" 这句有毒...
看了一下,线上demo里面是有一个showToast的方法settimeout的,但是npm下载的包里面并没有
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.