增加端口号配置

This commit is contained in:
dengtongyu committed 2018-12-13 18:30:29 +08:00
1 parent 8e4bb98518
commit fce7310de4
6 files changed
+93 -6

No files matched your search

+7 -4
View File
@@ -1,7 +1,10 @@
{ {
"template": "react", "template": "react",
"style": "css", "https": false,
"proxy": { "port":8088,
"/api": "http://localhost:3000" "proxy":[{
} "context": ["/api"],
"target": "http://localhost:8080/",
"secure": false
}]
} }
@@ -2,4 +2,22 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size: 16px; font-size: 16px;
display: flex;
justify-content: space-around;
}
.group {
height: 100%;
flex: 1;
}
.row {
display: flex;
justify-content: space-around;
}
.item {
width: 10px;
height: 10px;
background-color: lightgreen;
} }
+64 -1
View File
@@ -4,10 +4,73 @@ import React, { Component } from 'react';
import './app.css'; import './app.css';
class App extends Component { class App extends Component {
constructor () {
super();
this.front = 2;
this.back = 10;
this.gap = 2;
this.group = 4;
this.lines = (this.back - this.front) / this.gap;
this.state = {
seatList:[]
}
}
groupName(g) {
let name = '';
switch(g) {
case 0:
name = 'A';
break;
case 1:
name = 'B';
break;
case 2:
name = 'C';
break;
case 3:
name = 'D';
break;
}
return name;
}
componentDidMount() {
let list = [];
for (let g = 0; g < this.group; g++) {
for (let line = this.lines; line >= 0; line--) {
for (let seat = 0; seat < (this.back - this.gap * (this.lines - line)); seat++) {
list.push({
group: this.groupName(g),
number: seat,
row: line,
disable:false
});
}
};
}
this.setState({
seatList:list
});
console.log(list)
}
renderSeat() {
}
render() { render() {
return ( return (
<div className="app"> <div className="app">
Hello World! <div className="group">
<div className="row">
<div className="item"></div>
</div>
</div>
</div> </div>
); );
} }
+2
View File
@@ -7,4 +7,6 @@ body {
#root { #root {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 30px 20px;
box-sizing: border-box;
} }
+1 -1
View File
@@ -69,7 +69,7 @@ exports.run = (paths, command) => {
contentBase: path.join(paths.targetPath, "dist"), contentBase: path.join(paths.targetPath, "dist"),
compress: true, compress: true,
host: 'localhost', host: 'localhost',
port: 8088, port: _configJson.port ? _configJson.port : 8088,
hot: true, hot: true,
//open: true, //open: true,
stats: {colors: true}, stats: {colors: true},
+1
View File
@@ -1,6 +1,7 @@
{ {
"template": "react", "template": "react",
"https": false, "https": false,
"port":8088,
"proxy":[{ "proxy":[{
"context": ["/api"], "context": ["/api"],
"target": "http://localhost:8080/", "target": "http://localhost:8080/",