Skip to content

Commit f76ff61

Browse files
committed
修改 ejs 模板,使其接受 prompts 的参数
1 parent 52a329b commit f76ff61

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

generator/template/src/App.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,27 @@
88
}
99

1010
.App-header {
11+
<% if (appStyle === 'Vue') { %>
12+
background-color: #FFF;
13+
color: #2c3e50;
14+
<% } else { %>
1115
background-color: #282c34;
16+
color: white;
17+
<% } %>
1218
min-height: 100vh;
1319
display: flex;
1420
flex-direction: column;
1521
align-items: center;
1622
justify-content: center;
1723
font-size: calc(10px + 2vmin);
18-
color: white;
1924
}
2025

2126
.App-link {
27+
<% if (appStyle === 'Vue') { %>
28+
color: #3eaf7c;
29+
<% } else { %>
2230
color: #61dafb;
31+
<% } %>
2332
}
2433

2534
@keyframes App-logo-spin {

generator/template/src/App.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React, { Component } from 'react';
2+
<% if (appStyle === 'Vue') { %>
3+
import logo from './assets/logo.png';
4+
<% } else { %>
25
import logo from './logo.svg';
6+
<% } %>
37
import './App.css';
48

59
class App extends Component {
@@ -17,7 +21,11 @@ class App extends Component {
1721
target="_blank"
1822
rel="noopener noreferrer"
1923
>
24+
<% if (appStyle === 'Vue') { %>
25+
I love Vue!
26+
<% } else { %>
2027
Learn React
28+
<% } %>
2129
</a>
2230
</header>
2331
</div>

0 commit comments

Comments
 (0)