USER MATERIAL 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
Error: Parsing file C:\Users\wzx\AppData\Roaming\npm\1.jsx: Unexpected token (7:
11)
at Deps.parseDeps
unknow <RaisedButton label="Default" />
github:https://github.com/callemall/material-ui
1 npm install material-ui
2 Then how to do?
3 ...
4 ....
我接下来该怎么做?
我需要帮助,我已经做了几天
答案 0 :(得分:1)
我也很困惑,但是在我搜索之后我就把它弄出来了。
$ sudo npm install -g browserify
$ npm install --save-dev reactify
您现在拥有所有依赖项,接下来您需要该文件,您的示例是:
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>
这将输出文件,该文件将包含您需要的所有内容!