Skip to content

Commit defc3ca

Browse files
author
liujing
committedFeb 24, 2017
add tools gif
1 parent 0875177 commit defc3ca

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed
 

‎README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ Rock是一个Express + Webpack `脚手架`。可生成简单,稳定的Node服
5050
4. 访问 `http://localhost:8081`
5151

5252
### 其他命令
53-
* Client Side
54-
yo rock:component
53+
* 生成前端组件
54+
55+
yo rock:component
56+
57+
![yo rock:component](/docs/image/rock-tools.gif?raw=true)
5558

5659
### 开发文档
5760
1. [Configuration vs. Definition](/docs/01%20Configuration%20vs.%20Definition.md)

‎component/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = generators.Base.extend({
107107
}
108108

109109
if (needJs) {
110-
const className = name.slice(0, 1).toUpperCase() + name.slice(1);
110+
const className = name.split('-').map((item) => item.slice(0, 1).toUpperCase() + item.slice(1)).join('');
111111
switch(type) {
112112
case 'react':
113113
this.fs.copyTpl(

‎component/templates/pageTemplate.ejs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% layout('common/layout') -%>
2-
<% block('head').append(`<link type="text/css" href="${assetsConfig.<?= name ?>.css}" rel="stylesheet" charset="utf-8">`) %>
2+
<% block('head').append(`<link type="text/css" href="${assetsConfig['<?= name ?>'].css}" rel="stylesheet" charset="utf-8">`) %>
33

44
<h2>当前页面是 <?= name ?></h2><? if (type === 'vue' || type === 'react') { ?>
55
<div id="app"></div><? } ?>
66

7-
<% block('footer').append(`<script src="${assetsConfig.<?= name ?>.js}"></script>`) %>
7+
<% block('footer').append(`<script src="${assetsConfig['<?= name ?>'].js}"></script>`) %>

‎docs/image/rock-tools.gif

7.88 MB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.