Coder Social home page Coder Social logo

react-weui's Introduction

React-WeUI

Build Status Github Workflow Status npm version

WeUI Components build with React.

Coverage Status PRs Welcome QQ

Docs

1.0.x documentation with live examples. 0.4.x documentation with live examples.

Installation

With npm:

If React is not installed

npm install --save react react-dom
npm install --save [email protected] react-weui

With React Installed

npm install [email protected] react-weui --save

To use the development version (API might changes on realese version)

npm install react-weui@alpha --save

With browser (CDN by unpkg)

Javacript

https://unpkg.com/[email protected]

CSS

https://unpkg.com/[email protected]/build/dist/react-weui.css

Example

We have several examples on the documentation. Here is the first one to get you started:

// app.js

import React from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'react-weui';
//import styles
import 'weui';
import 'react-weui/build/packages/react-weui.css';

const App = () => <Button>hello wechat</Button>;

ReactDOM.render((
    <App/>
), document.getElementById('container'));

Contributing

Welcome and send the PR in! Development of components will happen in this github repo.

See the contributing guidelines for details.

Mobile Demo

react-weui

1.0.0

License

The MIT License(http://opensource.org/licenses/MIT)

react-weui's People

Contributors

a9 avatar akuma avatar aquariuslt avatar cncolder avatar fritx avatar haibinyu avatar haxpor avatar holymonson avatar ivanwangcy avatar linkkingjay avatar n7best avatar na57 avatar pokka avatar progrape avatar shaozujie avatar yjcxy12 avatar z2014 avatar zaxlct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-weui's Issues

如何与现有的路由方案集成?

现在weui的组件没有一个好的接口与react常用的路由方案(比如react-router)集成。
比如Cell中带props href的时候直接render成
<a href="***"></a>
但是大多数情况下,需要用react-router的Link来渲染,这个有没有什么好的解决方案?

能否将 react 更新到 15.x

现在如果使用 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 之后没有报错了。

Form Proposal

新增4个组件: Form, FormCell, Input, Label

Form:

  • props: none
  • className: weui_cells, weui_cells_form

FormCell:

  • props: vcode(bool), warn(bool)
  • className: weui_cell, weui_vocde(vcode), weui_cell_warn(warn)

Input:

  • props: defaultValue
  • className: weui_input
  • remark: 没有children, defaultValue加到attribute

Label:

  • props: none
  • className: weui_label

Discussion:

  • 是否把Form和FormCell整合到一起

TODO:

  • add tests after approval of idea
  • add docs

具体code请看 #32

cells的access逻辑问题

当有多个cell用于展示同一类型信息的时候使用cells(如展示个人资料等)。
但是access是在cells上 ,此时又某一cell不需要access,就需要重新使用一个cells,这体验略差

npm start 报错

执行
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
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in /Users/xxx/opensource/weui/react-weui/node_modules/react-dom
@ ./
/react-dom/index.js 3:17-46

ERROR in .//react-addons-css-transition-group/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactCSSTransitionGroup' in /Users/xxx/opensource/weui/react-weui/node_modules/react-addons-css-transition-group
@ ./
/react-addons-css-transition-group/index.js 1:17-61

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
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/Router.js 19:13-29

ERROR in .//react-router/lib/Link.js
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/Link.js 15:13-29

ERROR in .//react-router/lib/IndexLink.js
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/IndexLink.js 13:13-29

ERROR in .//react-router/lib/IndexRedirect.js
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/IndexRedirect.js 19:13-29

ERROR in .//react-router/lib/IndexRoute.js
Module not found: Error: Cannot resolve module 'react' in /Users/xxx/opensource/weui/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/IndexRoute.js 19:13-29

按照要求安装启动以后报错,报错信息如下

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
Module not found: Error: Cannot resolve module 'react/lib/ReactCSSTransitionGroup' in E:\demo\weixin\react-weui\node_modules\react-addons-css-transition-group
@ ./
/react-addons-css-transition-group/index.js 1:17-61

ERROR in .//react-dom/index.js
Module not found: Error: Cannot resolve module 'react/lib/ReactDOM' in E:\demo\weixin\react-weui\node_modules\react-dom
@ ./
/react-dom/index.js 3:17-46

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
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/Router.js 19:13-29

ERROR in .//react-router/lib/Link.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/Link.js 15:13-29

ERROR in .//react-router/lib/IndexLink.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/IndexLink.js 13:13-29

ERROR in .//react-router/lib/IndexRedirect.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/IndexRedirect.js 19:13-29

ERROR in .//react-router/lib/Redirect.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/Redirect.js 15:13-29

ERROR in .//react-router/lib/IndexRoute.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/IndexRoute.js 19:13-29

ERROR in .//react-router/lib/Route.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/Route.js 15:13-29

ERROR in .//react-router/lib/Lifecycle.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/Lifecycle.js 7:13-29

ERROR in .//react-router/lib/RouteContext.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/RouteContext.js 7:13-29

ERROR in .//react-router/lib/RouteUtils.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/RouteUtils.js 14:13-29

ERROR in .//react-router/lib/RoutingContext.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/RoutingContext.js 17:13-29

ERROR in .//react-router/lib/PropTypes.js
Module not found: Error: Cannot resolve module 'react' in E:\demo\weixin\react-weui\node_modules\react-router\lib
@ ./
/react-router/lib/PropTypes.js 6:13-29

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

能否将 react 更新到 15.x

如果使用 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* 需要继承 className

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的。感谢!

searchbar 提交的问题

在searchbar中输入内容后,点keyboard上的search后,会直接刷新页面,原来的输入的内容会丢失。
看了下代码发现几个问题:
input没有name,导致提交的时候,输入的内容不能通过querystring提交
form没有相关事件,导致没办法prevent默认动作(比如取消keyboard提交事件)。

这个有workround吗?

Button的disabled属性无效

当我使用 <Button disabled>删除</Button> 时,只能改变样式,但此按钮还是可以触发click事件的,看了代码发现,disabled属性没有被设置到button上。
这是故意的,还是一个bug?

tabbar 无法切换tab

在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>

0.3 beta issues

Navbar:

Searchbar:

  • [ios] cancel icon not responding when tap on real device [fixed with #63]

Components Roadmap

WeUI 0.3.0 Components

  • Actionsheet
  • Article
  • Button
  • Cell
  • Dialog
    • Alert
    • Confirm
  • Form
    • Label - [0.3 beta]
    • Input -[0.3 beta]
    • Textarea - [0.3 beta]
    • Radio [0.3 beta]
    • Checkbox [0.3 beta]
    • Select [0.3 beta]
    • Switch - [0.3 beta]
    • Uploader - [0.3 beta]
  • Grid
  • Msg Page
  • Toast
  • Progress
  • Icon
    • Add custom class #63

WeUI 0.4.0

  • Tabbar [0.3 beta]
  • Navbar [0.3 beta]
  • Panel - [0.3 beta]
    • MediaBox - [0.3 beta]
  • Search Bar [0.3 beta]

Other

  • Gallery
  • Swiper / Slider
  • Pull To Refresh
  • Infinity Scroll
  • Router
  • Card

Confirm 和 Alert 的区别?

dialogConfirmAlert 的区别似乎只是内容左对齐或居中的样式不同?统一成 Dialog 然后加个 style 参数会更简单么?

npm start异常

/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)

clone 后项目跑不起来

按此说明运行项目:
开发
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打包后bundle文件体积过大

@n7best
你好@n7best,我按照文档中的例子,

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-weui在实际项目中到底怎么用,求指点??

写了一个简单的组件,总是说state有错,Y?

跑首页的示例是成功的,但新建了一个组件,调用了一下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,

建议加快 beta 版本的更新

类似 #72 这样的问题修改之后,建议即时更新 beta 版本,以便能够基于最新版本开发,不至于出现报错后无法使用的问题。

需要 Loading Toast

WeUI 的 Demo 中是有 Loading Toast ,但是 React-WeUI 没有,看了一下代码只能传入一个 WeUI ICON ,但是 WeUI Toast 中的 loading 并不是一个标准 ICON 。

webpack: bundle is now VALID.

请问一下这是什么问题?

ERROR in .//react-router/lib/Router.js
Module not found: Error: Cannot resolve module 'history/lib/createHashHistory' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/Router.js 23:35-75

ERROR in .//react-router/lib/useRoutes.js
Module not found: Error: Cannot resolve module 'history/lib/Actions' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/useRoutes.js 15:25-55

ERROR in .//react-router/lib/useRoutes.js
Module not found: Error: Cannot resolve module 'history/lib/useQueries' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/useRoutes.js 17:28-61

ERROR in .//react-router/lib/match.js
Module not found: Error: Cannot resolve module 'history/lib/createMemoryHistory' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/match.js 13:37-79

ERROR in .//react-router/lib/match.js
Module not found: Error: Cannot resolve module 'history/lib/useBasename' in /Users/hubinjie/Documents/app/html5/react/react-weui/node_modules/react-router/lib
@ ./
/react-router/lib/match.js 17:29-63
webpack: bundle is now VALID.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.