材料ui安装配置 [英] material ui Installation configure

查看:53
本文介绍了材料ui安装配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户材料ui

1.jsx

var React = require('react'),
  mui = require('material-ui'),
  RaisedButton = mui.RaisedButton;

var MyAwesomeReactComponent = React.createClass({

  render: function() {
    return (
      <RaisedButton label="Default" />
    );
  }

});

module.exports = MyAwesomeReactComponent;

browserify 1.jsx -o 1.js

browserify 1.jsx -o 1.js

Error: Parsing file C:\Users\wzx\AppData\Roaming\npm\1.jsx: Unexpected token (7:
11)
    at Deps.parseDeps 

知道<RaisedButton label="Default" />

github: https://github.com/callemall/material-ui

1 npm install material-ui

2 Then how to do?

3 ...

4 ....

我下一步该怎么做?

我需要帮助,我已经做了几天

i need help, i have done a few days

推荐答案

我也感到困惑,但是我四处搜寻后就解决了.

I got confused as well, but I worked it out after I searched around.

$ sudo npm install -g browserify
$ npm install --save-dev reactify

您现在拥有所有依赖项,接下来需要文件,您的示例是:

you now have all the dependencies, next you need the file, your example is:

var React = require('react'),
  mui = require('material-ui'),
  RaisedButton = mui.RaisedButton;

var MyAwesomeReactComponent = React.createClass({

  render: function() {
    return (
      <RaisedButton label="Default" />
    );
  }

});

module.exports = MyAwesomeReactComponent;

然后您需要运行此命令

$ browserify -t reactify <path to jsx file> -o <path to output location, including file name>

这将输出文件,其中将包含您所需的一切!

this will output the file, which will have everything you need!

这篇关于材料ui安装配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆