Commit 02213f41 by 万亚飞

fix bug

parent a4387fd9
...@@ -7,11 +7,10 @@ function resolveRoot(dir) { ...@@ -7,11 +7,10 @@ function resolveRoot(dir) {
module.exports = { module.exports = {
entry: { entry: {
vendor: ['babel-polyfill', 'react'], vendor: ['babel-polyfill'],
app: resolveRoot('src/index.js') app: resolveRoot('src/index.js')
}, },
output: { output: {
filename: 'js/[name].[contenthash:8].js',
path: resolveRoot('dist') path: resolveRoot('dist')
}, },
plugins: [new webpack.NamedModulesPlugin()], plugins: [new webpack.NamedModulesPlugin()],
......
...@@ -11,12 +11,13 @@ function resolveRoot(dir) { ...@@ -11,12 +11,13 @@ function resolveRoot(dir) {
return path.join(__dirname, '..', dir); return path.join(__dirname, '..', dir);
} }
module.exports = merge(base, { module.exports = merge(base, {
devtool: 'cheap-module-eval-source-map',
// entry: { // entry: {
// vendor: ['react', 'better-scroll', 'react-redux', 'react-lazyload'] // vendor: ['react', 'better-scroll', 'react-redux', 'react-lazyload']
// }, // },
output: { output: {
publicPath: '/' publicPath: '/',
// filename: 'js/[name].[hash:8].js', filename: 'js/[name].[hash:8].js'
}, },
module: { module: {
rules: [ rules: [
...@@ -112,11 +113,11 @@ module.exports = merge(base, { ...@@ -112,11 +113,11 @@ module.exports = merge(base, {
], ],
mode: 'development', mode: 'development',
devServer: { devServer: {
contentBase: '../build', contentBase: '/',
host: '0.0.0.0', host: '0.0.0.0',
historyApiFallback: true, historyApiFallback: true,
open: true, open: true,
port: 5000, port: 5002,
hot: true hot: true
} }
}); });
...@@ -19,9 +19,10 @@ function resolveRoot(dir) { ...@@ -19,9 +19,10 @@ function resolveRoot(dir) {
return path.join(__dirname, '..', dir); return path.join(__dirname, '..', dir);
} }
module.exports = merge(base, { module.exports = merge(base, {
devtool: 'source-map',
output: { output: {
publicPath: '/new/' publicPath: '/new/',
// filename: 'js/[name].[contenthash:8].js' filename: 'js/[name].[contenthash:8].js'
}, },
module: { module: {
rules: [ rules: [
......
//开发环境 //开发环境
module.exports = { module.exports = {
NODE_ENV: '"development"', NODE_ENV: '"development"',
ENV_MARK: 'development', ENV_MARK: '"development"',
prefix: '"https://testapi.ydl.com/api"', prefix: '"https://testapi.ydl.com/api"',
prefixH2: '"https//testh2.yidianling.com"' prefixH2: '"https//testh2.yidianling.com"'
}; };
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
}, },
"betterScripts": { "betterScripts": {
"build:dev": { "build:dev": {
"command": "webpack --config ./build/webpack.dev.js", "command": "webpack-dev-server --config ./build/webpack.dev.js",
"env": { "env": {
"ENV_MARK": "development" "ENV_MARK": "development"
} }
......
...@@ -31,9 +31,10 @@ class TrainItem extends Component { ...@@ -31,9 +31,10 @@ class TrainItem extends Component {
<div className="item-operate box-c"> <div className="item-operate box-c">
<span <span
onClick={() => { onClick={() => {
if (data.id == '-1') return;
this.props.delToggle({ id: data.id, delType: iType, modifyId: data.modifyId }); this.props.delToggle({ id: data.id, delType: iType, modifyId: data.modifyId });
}} }}
className="o-btn" className={classNames('o-btn', { disabled: data.id == '-1' })}
> >
删除 删除
</span> </span>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
import Mock from 'mockjs'
import homeData from './homeData.json'
import categoryData from './category.json'
Mock.mock('/slides', { code: 0, data: homeData.slides }) //swiper的图片
Mock.mock('/policyDescList', { code: 0, data: homeData.policyDescList }) // //siwper下面三个标签的内容
Mock.mock('/kingKongModule', { code: 0, data: homeData.kingKongModule.kingKongList }) //请求siwper下面十个图片和描述
Mock.mock('/indexActivityModule', { code: 0, data: homeData.indexActivityModule }) //请求新人专享礼下面的图片
Mock.mock('/tagList', { code: 0, data: homeData.tagList }) //请求品牌制造商直供内容
Mock.mock('/categoryList', { code: 0, data: homeData.categoryHotSellModule.categoryList }) //请求类目热销榜
Mock.mock('/popularitemList', { code: 0, data: homeData.popularItemList }) //请求人气推荐的内容
Mock.mock('/flashSaleModule', { code: 0, data: homeData.flashSaleModule.itemList }) //请求限时购模块内容
Mock.mock('/newItemList', { code: 0, data: homeData.newItemList }) //请求新品首发模块内容
Mock.mock('/categoryModule', { code: 0, data: homeData.categoryModule }) //categoryModule模块的内容
Mock.mock('/categoryL1List', { code: 0, data: categoryData.categoryL1List }) //请求分类页面的全部内容
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment