fix prop-types

This commit is contained in:
zuiidea
2017-04-18 09:56:15 +08:00
parent db8b283def
commit 4a694b6df8
33 changed files with 69 additions and 94 deletions
+3 -10
View File
@@ -7,6 +7,7 @@
"dva": "^1.1.0",
"dva-loading": "^0.2.0",
"lodash": "^4.17.4",
"nprogress": "^0.2.0",
"qs": "^6.2.0",
"react": "^15.4.1",
"react-countup": "1.3.0",
@@ -41,16 +42,8 @@
"lint"
],
"scripts": {
"dev": "set BROWSER=none&&roadhog server",
"dev": "set BROWSER=none&&set HOST=0.0.0.0&&roadhog server",
"lint": "eslint --fix --ext .js src",
"build": "roadhog build"
},
"theme": "./src/theme.js",
"standard": {
"parser": "babel-eslint",
"globals": [
"location",
"localStorage"
]
"build": "roadhog build --analyze"
}
}
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { TweenOneGroup } from 'rc-tween-one'
const enterAnim = [
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Table } from 'antd'
import { request } from '../../utils'
import lodash from 'lodash'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Dropdown, Button, Icon, Menu } from 'antd'
const DropOption = ({ onMenuClick, menuOptions = [], buttonStyle, dropdownProps }) => {
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import './iconfont.less'
const Iconfont = ({ type }) => <span
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Breadcrumb, Icon } from 'antd'
import { Link } from 'dva/router'
import styles from './Bread.less'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Menu, Icon, Popover } from 'antd'
import styles from './Header.less'
import Menus from './Menu'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Menu, Icon } from 'antd'
import { Link } from 'dva/router'
import { menu } from '../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Icon, Switch } from 'antd'
import styles from './Layout.less'
import { config } from '../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom'
import styles from './Search.less'
import { Input, Select, Button, Icon } from 'antd'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Router } from 'dva/router'
import App from './routes/app'
+6 -3
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Layout } from '../components'
import { classnames, config } from '../utils'
@@ -7,7 +8,8 @@ import '../themes/index.less'
const { Header, Bread, Footer, Sider, styles } = Layout
const App = ({ children, location, dispatch, app }) => {
const App = ({ children, location, dispatch, app, loading }) => {
console.log(loading)
const { user, siderFold, darkTheme, isNavbar, menuPopoverVisible, navOpenKeys } = app
const headerProps = {
@@ -81,6 +83,7 @@ App.propTypes = {
location: PropTypes.object,
dispatch: PropTypes.func,
app: PropTypes.object,
loading: PropTypes.object,
}
export default connect(({ app }) => ({ app }))(App)
export default connect(({ app, loading }) => ({ app, loading }))(App)
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './Container.less'
import { ResponsiveContainer } from 'recharts'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Row, Col, Card, Button } from 'antd'
import Container from '../Container'
import {
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Row, Col, Card, Button } from 'antd'
import Container from '../Container'
import {
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Table, Tag } from 'antd'
import styles from './browser.less'
import { color } from '../../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Table, Tag } from 'antd'
import styles from './comments.less'
import { color } from '../../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './completed.less'
import classnames from 'classnames'
import { color } from '../../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './cpu.less'
import { color } from '../../../utils'
import CountUp from 'react-countup'
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Icon, Card } from 'antd'
import CountUp from 'react-countup'
import styles from './numberCard.less'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './quote.less'
function Quote ({ name, content, title, avatar }) {
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Table, Tag } from 'antd'
import styles from './recentSales.less'
import { color } from '../../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './sales.less'
import classnames from 'classnames'
import { color } from '../../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Button } from 'antd'
import styles from './user.less'
import CountUp from 'react-countup'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import styles from './weather.less'
function Weather ({ city, icon, dateTime, temperature, name }) {
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Row, Col, Card } from 'antd'
import { NumberCard, Quote, Sales, Weather, RecentSales, Comments, Completed, Browser, Cpu, User } from './components'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Button, Row, Form, Input } from 'antd'
import { config } from '../../utils'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Button, Row, Col, Switch } from 'antd'
import { Search } from '../../components'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Table, Modal } from 'antd'
import styles from './UserList.less'
import classnames from 'classnames'
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { Form, Input, InputNumber, Radio, Modal } from 'antd'
const FormItem = Form.Item
+2 -1
View File
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'
import { routerRedux } from 'dva/router'
import { connect } from 'dva'
import UserList from './UserList'
+2 -2
View File
@@ -1,10 +1,10 @@
import { request, config } from '../utils'
const { api } = config
const { userInfo, userLogout } = api
const { userInfo, userLogout, userLogin } = api
export async function login (params) {
return request({
url: '/api/login',
url: userLogin,
method: 'post',
data: params,
})
-50
View File
@@ -1,50 +0,0 @@
const webpack = require('atool-build/lib/webpack')
module.exports = function (webpackConfig, env) {
webpackConfig.babel.plugins.push('transform-runtime')
webpackConfig.babel.plugins.push(['import', {
libraryName: 'antd',
style: true,
}])
// Support hmr
if (env === 'development') {
webpackConfig.devtool = '#eval'
webpackConfig.babel.plugins.push(['dva-hmr', {
entries: [
'./src/index.js',
],
}])
} else {
webpackConfig.babel.plugins.push('dev-expression')
webpackConfig.entry = { index: './src/_index.js' }
}
// Don't extract common.js and common.css
webpackConfig.plugins = webpackConfig.plugins.filter((plugin) => {
return !(plugin instanceof webpack.optimize.CommonsChunkPlugin)
})
// Support CSS Modules
// Parse all less files as css module.
webpackConfig.module.loaders.forEach((loader) => {
if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.less$') > -1) {
loader.include = /node_modules/
loader.test = /\.less$/
}
if (loader.test.toString() === '/\\.module\\.less$/') {
loader.exclude = /node_modules/
loader.test = /\.less$/
}
if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.css$') > -1) {
loader.include = /node_modules/
loader.test = /\.css$/
}
if (loader.test.toString() === '/\\.module\\.css$/') {
loader.exclude = /node_modules/
loader.test = /\.css$/
}
})
return webpackConfig
}