Tag: material ui

试图根据选定的选项显示字段

我有团队和竞争的注册部分,但是我想要做的是当用户select比赛时,我想显示促销代码字段,并且只有在select了比赛时显示该字段,如果select了团队,它将不会显示促销领域,谢谢提前。 React.Component { constructor(props) { super(props); this.state = {name: '', email: '', password: ''}; } handleChange(event) { this.setState({ [event.target.name]: event.target.value }); } handleSelect(event, index, value) { this.setState({type: value}); } handleSignup(event) { event.preventDefault(); this.props.dispatch(signup(this.state.name, this.state.email, this.state.password, this.state.promo, this.state.type)); } render() { return ( <div className="login"> <div className="panel"> <div className="body"> <legend>Create an account</legend> <SelectField floatingLabelText="User or Admin" […]

Npm包提供一个Material-UI HOC到一个Nextjs应用程序

问题描述 我正在尝试通过npm包提供Material-UI到Nextjs应用程序。 npm包使用Webpack。 这一切正常,但我得到一个错误消息。 这个东西稍微超出了我对npm packages&webpack的理解,我可能不会这样做,如果是这样的话,请提供build议。 错误消息 警告:上下文types失败: 64a55d578f856d258dc345b094a2a2b3types的上下文64a55d578f856d258dc345b094a2a2b3提供给withStyles(ButtonBase) , Jss预期实例。 警告:上下文types失败:提供给withStyles(TouchRipple)types的SheetsRegistrytypes的无效上下文d4bd0baacbc52bbd48bbb9eb24344ecd ,为withStyles(TouchRipple)预期实例。 重现步骤 这只会让你检查错误。 git clone https://github.com/astenmies/next-library-starter.git && cd next-library-starter && yarn && yarn run dev 调整npm包的步骤 这将让你检查错误,并调整本地运行的npm包。 首先得到npm包并运行它 git clone https://github.com/astenmies/next.js-library.git && cd next.js-library && yarn && yarn run dev 然后在你的terminal的另一个选项卡上,在上述相同的根目录下…获取nextjs应用程序,删除npm包,获取linklocal并运行应用程序。 git clone https://github.com/astenmies/next-library-starter.git && cd next-library-starter && yarn remove next-library && yarn […]

使用材料与电子ui

我正在用React构build一个电子应用程序,并试图为UI元素使用Material-UI。 我添加了一个datepicker和timepicker到一个组件和input显示在电子应用程序,但是当你点击它,没有任何反应。 不知道我错过了什么,为了让这个工作正常 零件 : import React, { Component } from 'react'; import DatePicker from 'material-ui/DatePicker'; import TimePicker from 'material-ui/TimePicker'; export default class Schedule extends Component { render() { return ( <div> Pick a date : <DatePicker id="date"/> and time : <TimePicker id="time"/> </div> ) } } index.js: import 'babel-polyfill'; // generators import React from […]

从React中的Material UI开始的步骤

我正尝试在React中使用material-ui,但是我不知道如何让它工作。 我遵循了文档,并做了如下: npm安装材料 – 用户界面 npm安装 然后在我的App.js中插入“从react-tap-event-plugin”导入injectTapEventPlugin; 然后“从”material-ui / RaisedButton“导入RaisedButton; 我的App.js像这样RaisedButton <RaisedButton label="Default" /> 但是当我运行它时,什么也没有显示在浏览器中。 import React from 'react' require('../../scss/style.scss'); import Userlist from "../Containers/user-list" import UserDetail from '../Containers/user-detail' import injectTapEventPlugin from 'react-tap-event-plugin'; import RaisedButton from 'material-ui/RaisedButton'; const App =() =>( <div> <RaisedButton label="Default" /> <h2> Username list </h2> <Userlist/> <hr/> <h2> User Detail </h2> <hr/> […]

材料使用入门

对我来说,保守秘密就是material-ui,一个使用Google的Material Design UI和React的web框架。 我认为这是一个梦幻般的组合和未来。 但是,如何使用它也是一个保存完好的秘密。 http://material-ui.com/#/get-started上的入门指南不适用于普通的Joe,但仅适用于可以理解的一小部分人员。 而且,这里的问题,比如如何使用material-ui框架? , 材料ui安assembly置 ,从来没有回答过。 我设法安装了material-ui, $ npm install material-ui react-tap-event-plugin@0.1.6 node_modules/react-tap-event-plugin react@0.13.2 node_modules/react envify@3.4.0 (through@2.3.7, jstransform@10.1.0) material-ui@0.7.4 node_modules/material-ui classnames@1.2.1 react-draggable2@0.5.1 $ ls -d1 node_modules/* node_modules/material-ui node_modules/react node_modules/react-tap-event-plugin 但接下来呢? 我应该将它们移到我的/var/www/ ? 或者启动nodejs,或者…? 我怎样才能看到一个简单的演示,显示一切正在工作? 总而言之,作为一个只知道http服务器和静态html页面的人,对我来说,看到它的最简单方法是在我自己的环境中使用我现有的web服务器吗? 谢谢 $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.10 Release: […]