fireyy / react-antd-admin Goto Github PK
View Code? Open in Web Editor NEWThis Project Is Deprecated. Use [Ant Design Pro](https://pro.ant.design/) instead.
License: MIT License
This Project Is Deprecated. Use [Ant Design Pro](https://pro.ant.design/) instead.
License: MIT License
需要增大node.js内存,吗,怎么增加啊
npm install 之后发现依然有不少库没有装。
I notice you have define validate
function in src/utils/auth.js
,the old function define stil exists in src/route/index.js. You'd better remove extra code.
after clone the project, I use npm install . then npm run dev . but localhost:3000 has no response.
github page
use plain JavaScript class instead or creat-react-class #22
close
ERROR in ./src/index.js
Module parse failed: d:\Project\NODE\react-antd-admin\src\index.js Unexpected token (27:2)
You may need an appropriate loader to handle this file type.
我知道是jsx的原因,代码中那里配置呢?
menu.js?d576:41
Uncaught TypeError: Cannot read property 'key' of undefined
at eval (eval at <anonymous> (http://localhost:3000/bundle.js:3667:2), <anonymous>:59:25)
at Array.map (native)
at menu (eval at <anonymous> (http://localhost:3000/bundle.js:3667:2), <anonymous>:39:39)
at combination (eval at <anonymous> (http://localhost:3000/bundle.js:2821:2), <anonymous>:133:29)
at computeNextEntry (eval at <anonymous> (http://localhost:3000/bundle.js:3685:2), <anonymous>:138:21)
at recomputeStates (eval at <anonymous> (http://localhost:3000/bundle.js:3685:2), <anonymous>:172:17)
at eval (eval at <anonymous> (http://localhost:3000/bundle.js:3685:2), <anonymous>:556:22)
at Object.dispatch (eval at <anonymous> (http://localhost:3000/bundle.js:2785:2), <anonymous>:178:22)
at dispatch (eval at <anonymous> (http://localhost:3000/bundle.js:3685:2), <anonymous>:605:19)
at eval (eval at <anonymous> (http://localhost:3000/bundle.js:2857:2), <anonymous>:34:18)
The page runs well, but the console print TypeError when click Home on the left SideBar. The file react-antd-admin/src/reducers/menu.js may have some errors.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "E:\Program Files\nodejs\node.exe" "E:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "start"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! E:\Program Files\react\react-antd-admin\npm-debug.log
Hi, I add a new component Register
in src/views/Register/index.jsx, I add the route map in src/route/index.js:
const routes = (
<Switch>
<Route path="/login" component={Login}/>
<Route path="/register" component={Register}/>
<Route path="/" component={Layout}/>
</Switch>
);
Then, I add a button to get to the register page when clicked, however I can not finish it.I try below ways:
I bind a toRegister
function to a button in src/views/Login
component.
toRegister () {
const { history } = this.props
history.replace("/register")
}
this throw exception: Uncaught TypeError: Cannot read property 'replace' of undefined
I import hashHistory form react-router in src/views/Login
import { hashHistory } from 'react-router';
But I got 82:6-17 "export 'hashHistory' was not found in 'react-router'
I notice this project uses new route ways with latest react version. I am not familiar with route. So can you help me how to route from Login page to Register page when click button in Login page. Thanks.
版本很老了,貌似语法都不一样了。导入后,加一些东西会报错
你好,我刚接触reactjs,用了你的脚手架,但是有一点不太清楚,不知道怎么切换页面。
我想实现:点击左侧的菜单,右边的内容改变。
应该是跟react-router和redux有关,但是始终没反应,也没报错。
求大神指导,谢谢!
total output:
➜ react-antd-admin git:(master) ✗ npm run deploy
> [email protected] deploy /home/geek/workspace/reactwp/react-antd-admin
> now ./dist -n react-antd-admin
sh: now: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] deploy: `now ./dist -n react-antd-admin`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
do a full reload now
之前 clone了一个版本,.babelrc 有个配置
"env": {
"development": {
"presets": ["react-hmre"]
}
}
现在 .babelrc 把该配置去掉了,我在修改组件之后并没有更新。
并且会报如下提示:
process-update.js:81[HMR] The following modules couldn't be hot updated: (Full reload needed)
This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See http://webpack.github.io/docs/hot-module-replacement-with-webpack.html for more details.
如果带上env配置, prod 打包以后 运行就会报 react module错误。
不知道该如何处理,希望能给一个方案。
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
我按照你的方式分别在dev和pro配置文件下 添加了这个配置,但是在srever.js判断不起作用,仍然是undefined我想问是不是还需要添加其他配置来解析?
菜单栏里有几个Menu都无法点击
如题
NODE_ENV=production PORT=3000 npm start
returns this HTML:
<html>
<head>
<title>React Ant.Design Admin UI</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="root">
</div>
</body>
<script src="/dist/bundle.js"></script>
</html>
However, there's no /dist/bundle.js
. It would be nice if the app had a build script too - this can be useful to see how big the production bundle.js
would be (the development version is 6MB+).
.babelrc
{
"presets": [
["env", { "modules": false }],
"react",
"stage-2"
],
"plugins": ["lodash",
"react-hot-loader/babel",
"syntax-dynamic-import",
"transform-runtime",
"transform-decorators-legacy", ["import", [{ "libraryName": "antd", "libraryDirectory": "lib", "style": "true" }]]
],
"env": {
"test": {
"presets": ["env", "react", "stage-2"]
}
}
}
本地demo 跑是没问题的,打包后的文件,跑不起来
问题描述:我通过登陆界面登录系统,进入主页面,然后刷新页面,此时页面又到了登录界面。
环境:chrome 51.0.2704.106 m浏览器, win10系统
这个不知道是bug还是什么,但总感觉不应该这样的,求大神指教,谢谢!
use prop-types instead #22
Error Cannot read property 'stop' of null at logout or at change page at first run
现在的体验不好
Total output is:
➜ react-antd-admin git:(master) ✗ npm run test
> [email protected] test /home/geek/workspace/reactwp/react-antd-admin
> mocha tests/.setup.js tests/**/*-test.js --compilers css:mocha-compiler.js
Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning.
module.js:487
throw err;
^
Error: Cannot find module '../src/components/Header/Header'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/geek/workspace/reactwp/react-antd-admin/tests/Header-test.js:4:1)
at Module._compile (module.js:569:30)
at loader (/home/geek/workspace/reactwp/react-antd-admin/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/geek/workspace/reactwp/react-antd-admin/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /home/geek/workspace/reactwp/react-antd-admin/node_modules/mocha/lib/mocha.js:230:27
at Array.forEach (native)
at Mocha.loadFiles (/home/geek/workspace/reactwp/react-antd-admin/node_modules/mocha/lib/mocha.js:227:14)
at Mocha.run (/home/geek/workspace/reactwp/react-antd-admin/node_modules/mocha/lib/mocha.js:495:10)
at Object.<anonymous> (/home/geek/workspace/reactwp/react-antd-admin/node_modules/mocha/bin/_mocha:469:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `mocha tests/.setup.js tests/**/*-test.js --compilers css:mocha-compiler.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in
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.