GithubHelp home page GithubHelp logo

fireyy / react-antd-admin Goto Github PK

View Code? Open in Web Editor NEW
598.0 36.0 161.0 758 KB

This Project Is Deprecated. Use [Ant Design Pro](https://pro.ant.design/) instead.

License: MIT License

JavaScript 95.41% CSS 4.17% HTML 0.42%
react antd admin-dashboard admin-ui admin-theme

react-antd-admin's Issues

npm run dev not work

after clone the project, I use npm install . then npm run dev . but localhost:3000 has no response.

按照实例步骤安装后,运行报错啊。

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的原因,代码中那里配置呢?

console print error: Uncaught TypeError: Cannot read property 'key' of undefined

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 run start报错

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

confused with router

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:

use this.props

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

use hashHistory from react-router

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有关,但是始终没反应,也没报错。
求大神指导,谢谢!

sh: now: command not found when npm run deploy

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.

.babelrc 热替换问题

之前 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错误。

不知道该如何处理,希望能给一个方案。

webpack definePlugin not work

new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
我按照你的方式分别在dev和pro配置文件下 添加了这个配置,但是在srever.js判断不起作用,仍然是undefined我想问是不是还需要添加其他配置来解析?

Does not work in production

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+).

babel-plugin-import 当设置 "style":true时样式未能引用是什么原因呢?

.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"]
        }
    }
}

top nav for sidebar

antd-admin-00

如上图右边,现在的左侧导航都是带下拉的,希望能提供一个顶级导航,与PagesFiles同一级别,点击后不下拉直接更新右侧内容。需求和上图左边的导航类似。

主页面刷新问题

问题描述:我通过登陆界面登录系统,进入主页面,然后刷新页面,此时页面又到了登录界面。
环境:chrome 51.0.2704.106 m浏览器, win10系统
这个不知道是bug还是什么,但总感觉不应该这样的,求大神指教,谢谢!

Error at logout

Error Cannot read property 'stop' of null at logout or at change page at first run

Error: Cannot find module '../src/components/Header/Header' when npm run test

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

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.