Skip to content

Commit 42aecdf

Browse files
committed
优化代码注释,优化注释规则逻辑。优化代码模块,新增对go、c和c++文件默认注释规则
1 parent 2ede878 commit 42aecdf

File tree

14 files changed

+1738
-573
lines changed

14 files changed

+1738
-573
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> An application to count code in electron-vue
44
5-
> version: 1.0.0
5+
> version: 1.0.1
66
77
> Author: Alan Chen
88
@@ -24,15 +24,15 @@
2424
2. 过滤功能只对文件夹生效,在弹窗中按enter添加,注意添加后缀名必须带上点
2525
3. 注释规则文件名不需要带点,规则分为多行注释和单行注释,非必填,一个后缀名文件可以添加多个规则,但不可重复。
2626
4. 软件默认过滤`node_modules``.git`两个文件夹。
27-
5. 软件默认提供js、html、css、jsx、java和vue等文件的注释规则
28-
6. 读取代码的原理其实是将目标文件的buffer转换成utf-8的string,所以只支持uft-8编码的文件,默认不支持图片和office所有文件!也不要读取非utf-8的文件,否则统计结果不可信。大多数code的编码格式是utf-8。
27+
5. 软件默认提供js、go、html、css、jsx、java、vue、c和c++等文件的注释规则
28+
6. 读取代码的原理其实是将目标文件的buffer转换成utf-8的string,所以只支持uft-8编码的文件,默认不支持图片和office所有文件!也不要读取非utf-8的文件,否则统计结果不可信。大多数code的编码格式是utf-8。例如:读取LICENSE文件会报错,软件异常
2929

3030
### Download
3131

32-
* [安装包版本](https://pan.baidu.com/s/1s-7ys5bYiYvApsj6g_i0uA) 密码: t4gy
33-
* [绿色版本](https://pan.baidu.com/s/1HZtqWzXlxCkJzUCEju1g7w) 密码: 3yhj
32+
* [安装包版本](https://pan.baidu.com/s/1IsWndIKNg71tfTIZ0-kyiw) 密码: sb5g
33+
* [绿色版本](https://pan.baidu.com/s/1ksohHS9X5cfThe4HMB8cBA) 密码: d8ir
3434

35-
### Dictionary Tree
35+
### Directory Tree
3636
``` bash
3737
├─.electron-vue electron-vue的webpack配置文件
3838
├─build
@@ -55,12 +55,13 @@
5555
```
5656

5757
### 踩坑记录
58-
1. electron本身下载必须翻墙!使用cnpm等着包出错吧~
58+
1. electron本身下载必须翻墙!使用cnpm等着包出错吧~建议全程使用yarn
5959
2. electron-builder 嗯...不用说了,翻墙吧
6060
3. 为了阻止程序多开,也是找了好久才找到makeSingleInstance这个api...
6161
4. 无边框窗口也是坑,默认的title右键菜单隐藏不了...嗯,就这样了
6262
5. 窗口的title只能从index.html里改变title标签...文档哪里说了?
63-
6. 感慨一下,还是原生node用的舒服,不用管什么electron重新编译一把...就这么多吧
63+
6. 主进程中window的icon必须是路径!不能是图片base64数据!所以在electron-vue中一定要把icon放在static目录
64+
7. 感慨一下,还是原生node用的舒服,不用管什么electron重新编译一把...就这么多吧
6465

6566
### Build Setup
6667

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codecounter",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"author": "alanchenchen <739709491@qq.com>",
55
"description": "An application to count code in electron-vue",
66
"license": "MIT",
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
<template>
2-
<FormItem>
3-
<div slot="label">
4-
{{itemData.title}}
5-
<Tooltip :content="itemData.tooltip">
6-
<Icon type="help-circled" size="16" color="#2d8cf0" class="cursor" />
7-
</Tooltip>
8-
</div>
9-
<i-switch v-model="itemData.enabled">
10-
<Icon type="android-done" slot="open"></Icon>
11-
<Icon type="android-close" slot="close"></Icon>
12-
</i-switch>
13-
<Button
14-
v-show="itemData.enabled"
15-
size="small"
16-
class="exclude_btn"
17-
type="dashed"
18-
@click="itemData.isModal = true">添加{{itemData.title}}</Button>
19-
</FormItem>
20-
</template>
21-
22-
<script>
23-
export default {
24-
props: {
25-
itemData: {
26-
type: Object,
27-
required: true
28-
}
29-
}
30-
}
31-
</script>
32-
33-
<style lang="css" scoped>
34-
.exclude_btn {
35-
margin-left: 40px;
36-
}
37-
.cursor {
38-
cursor: pointer;
39-
}
1+
<template>
2+
<FormItem>
3+
<div slot="label">
4+
<Tooltip :content="itemData.tooltip" placement="bottom-start">
5+
{{itemData.title}}
6+
<Icon type="help-circled" size="16" color="#2d8cf0" class="cursor" />
7+
</Tooltip>
8+
</div>
9+
<i-switch v-model="itemData.enabled">
10+
<Icon type="android-done" slot="open"></Icon>
11+
<Icon type="android-close" slot="close"></Icon>
12+
</i-switch>
13+
<Button
14+
v-show="itemData.enabled"
15+
size="small"
16+
class="exclude_btn"
17+
type="dashed"
18+
@click="itemData.isModal = true">添加{{itemData.title}}</Button>
19+
</FormItem>
20+
</template>
21+
22+
<script>
23+
export default {
24+
props: {
25+
itemData: {
26+
type: Object,
27+
required: true
28+
}
29+
}
30+
}
31+
</script>
32+
33+
<style lang="css" scoped>
34+
.exclude_btn {
35+
margin-left: 40px;
36+
}
37+
.cursor {
38+
cursor: pointer;
39+
}
4040
</style>
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
<template>
2-
<Modal v-model="modal.isModal" :styles="{marginTop: '-20px'}">
3-
<p slot="header" style="color:#2d8cf0;text-align:center">
4-
<Icon type="information-circled" />
5-
<span>{{modal.title}} 配置</span>
6-
</p>
7-
<p slot="footer" style="color:#2d8cf0;text-align:center">
8-
<Button long @click="modal.isModal=false">确 定</Button>
9-
</p>
10-
<div>
11-
<div class="inline">
12-
<p>{{modal.input.label}}</p>
13-
<Input
14-
v-model.trim="ipnutVal"
15-
placeholder="按enter键添加"
16-
style="width: 160px"
17-
clearable
18-
@on-enter="add" />
19-
</div>
20-
<div class="tagContent">
21-
<Tag
22-
v-for="(item, i) of modal.list"
23-
:key="i"
24-
:name="item"
25-
color="blue"
26-
closable
27-
type="border"
28-
@on-close="del">{{item}}</Tag>
29-
</div>
30-
</div>
31-
</Modal>
32-
</template>
33-
34-
<script>
35-
export default {
36-
props: {
37-
modal: {
38-
type: Object,
39-
required: true
40-
}
41-
},
42-
data() {
43-
return {
44-
ipnutVal: '',
45-
formData: {}
46-
}
47-
},
48-
methods: {
49-
add() {
50-
this.$emit('addTag', this.ipnutVal)
51-
this.ipnutVal = ''
52-
},
53-
del(e, name) {
54-
this.$emit('delTag', name)
55-
}
56-
}
57-
}
58-
</script>
59-
60-
<style lang="css" scoped>
61-
.tagContent {
62-
height: 100px;
63-
overflow: auto;
64-
}
65-
.inline {
66-
display: flex;
67-
justify-content: space-between;
68-
align-items: center;
69-
margin-bottom: 20px;
70-
}
1+
<template>
2+
<Modal v-model="modal.isModal" :styles="{marginTop: '-20px'}">
3+
<p slot="header" style="color:#2d8cf0;text-align:center">
4+
<Icon type="information-circled" />
5+
<span>{{modal.title}} 配置</span>
6+
</p>
7+
<p slot="footer" style="color:#2d8cf0;text-align:center">
8+
<Button long @click="modal.isModal=false">确 定</Button>
9+
</p>
10+
<div>
11+
<div class="inline">
12+
<p>{{modal.input.label}}</p>
13+
<Input
14+
v-model.trim="ipnutVal"
15+
placeholder="按enter键添加"
16+
style="width: 160px"
17+
clearable
18+
@on-enter="add" />
19+
</div>
20+
<div class="tagContent">
21+
<Tag
22+
v-for="(item, i) of modal.list"
23+
:key="i"
24+
:name="item"
25+
color="blue"
26+
closable
27+
type="border"
28+
@on-close="del">{{item}}</Tag>
29+
</div>
30+
</div>
31+
</Modal>
32+
</template>
33+
34+
<script>
35+
export default {
36+
props: {
37+
modal: {
38+
type: Object,
39+
required: true
40+
}
41+
},
42+
data() {
43+
return {
44+
ipnutVal: '',
45+
formData: {}
46+
}
47+
},
48+
methods: {
49+
add() {
50+
this.$emit('addTag', this.ipnutVal)
51+
this.ipnutVal = ''
52+
},
53+
del(e, name) {
54+
this.$emit('delTag', name)
55+
}
56+
}
57+
}
58+
</script>
59+
60+
<style lang="css" scoped>
61+
.tagContent {
62+
height: 100px;
63+
overflow: auto;
64+
}
65+
.inline {
66+
display: flex;
67+
justify-content: space-between;
68+
align-items: center;
69+
margin-bottom: 20px;
70+
}
7171
</style>

0 commit comments

Comments
 (0)