molin123 / react-molin Goto Github PK
View Code? Open in Web Editor NEWreact-molin是一个全新的基于webpack3、react15、react-router4、antd-mobile的前端架构实现方案(h5)
react-molin是一个全新的基于webpack3、react15、react-router4、antd-mobile的前端架构实现方案(h5)
1.请问大神部署什么服务器好呢?
手机端不支持直接用fetch()吧?没反应
npm start 就不用设置127.0.0.1了,直接在package.json里面指定好吧~
看到src文件夹中是一个js文件如app.js对应一个文件夹app对应一个页面吗?可我怎么又在app文件夹中分别看到了index 文件和list文件?list文件不应该是另一个页面吗,我启动服务后看到http://127.0.0.1:1024/home.html#/index 下排版错乱
嗨,可以跟你交流一个额外的话题么:
我最近在使用ant design mobile 做一个公司的项目,想基于它来构建我们自己的react组件库(也就是修改整体less变量,开发我们的组件)。但目前遇到的问题是我clone了ant design mobile的库到了本地,要怎么在我本地公司的项目引入这个antd-mobile到我的项目中呢?
我给你发了邮件,怕你没看见,所以在这留一个issue,如若打扰,还请谅解。
怎么嵌入高清方案
npm install 以后 提示了几个警告
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none was installed.
npm WARN [email protected] requires a peer of webpack@^2.2.0 but none was installed.
npm WARN [email protected] requires a peer of webpack@^2.2.0 but none was installed.
npm WARN [email protected] requires a peer of react-native@* but none was installed.
npm WARN [email protected] requires a peer of react-native@>=0.20.0 but none was installed.
npm WARN [email protected] No repository field.
npm run start报错
C:\Users\Administrator\Desktop\react-molin-master>npm run start
[email protected] start C:\Users\Administrator\Desktop\react-molin-master
export NODE_ENV=development && webpack-dev-server
'export' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
有报错
基于React Router 4.1 和 webpack 3、redux,如何做代码分片呢?
以前是在getComponent里面调用这个参数实现的:
require.ensure([], require => {
let foo = require('./foo');
reducerRegistry.register({foo: foo}); // 一个导入redux action的策略(使用分片)
cb(null, require('./PageCom'))
}, 'PageCom');
这是之前的策略,现在我把这个redux加进去,能给点建议吗?
写react的用户,用jsx的语法还是为多的,建议把jsx的配置也写在里面。方便某些新手~
when i use code split with bundle-loader
like this:
webpack.js
entry: {
'stargate-portal': './src/entry.jsx'
},
output: {
// path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, outputPath),
filename: 'res/js/[name].[hash:8].js',
chunkFilename: 'res/js/[name].[chunkhash:8].bundle.js',
publicPath: "./"
},
entry.jsx
const {
HashRouter,
Route,
Link,
Switch,
Redirect
} = ReactRouterDOM
import Home from '@/components/home';
// import Console from '@/components/console';
import Console from 'bundle-loader?lazy&name=storgate-portal-console!@/components/console';
// import ListContainer from 'bundle-loader?lazy&name=app-[name]!./app/list.js';
import './main.less';
import Bundle from './bundle';
const ConsoleLazy = () => (
<Bundle load={Console}>
{(Console) => <Console />}
</Bundle>
)
const Portal = () => (
<HashRouter>
<div className="stargate-portal">
<Switch>
<Route path="/console" component={ConsoleLazy} />
<Route path="/" component={Home} />
</Switch>
</div>
</HashRouter>
)
ReactDOM.render(
<Portal />,
document.getElementById('storgate-portal')
);
console/index.js
render() {
const consolePath = this.props.match.path;
return (
<Content style={{ background: '#fff', padding: 24, margin: '12px', height: 'auto' }}>
<Switch>
<Redirect exact from={`${consolePath}`} to={`${consolePath}/project_detail`} />
<Route path={`${consolePath}/project_detail`} component={ProjectDetail} />
<Route exact path={`${consolePath}/app`} component={AppList} />
<Route path={`${consolePath}/app/:id`} component={AppDetail} />
<Route exact path={`${consolePath}/contacts`} component={ContactsList} />
<Route path={`${consolePath}/contacts/:id`} component={ContactsDetail} />
<Route path={`${consolePath}/logs`} component={LogList} />
</Switch>
</Content>
);
}
the webpack output result is:
But when i get /console. browser take error:
TypeError: Cannot read property 'path' of undefined
what should i do?
项目还是需要eslint去校验代码的。这在公司项目里,还是挺需要的。
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.