Skip to content

Commit fb603ba

Browse files
committed
fix(index):完善整体内容第一版本
1 parent 4cc9016 commit fb603ba

File tree

7 files changed

+41
-39
lines changed

7 files changed

+41
-39
lines changed

dist/assets/index.29d2518c.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/assets/index.3477520e.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/assets/index.8ce7c652.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/index.f5a643ec.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" href="./favicon.ico" />
6+
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
<title>Vite App</title>
8-
<script type="module" crossorigin src="./assets/index.29d2518c.js"></script>
9-
<link rel="modulepreload" href="./assets/vendor.48afde62.js">
10-
<link rel="stylesheet" href="./assets/index.3477520e.css">
9+
<script type="module" crossorigin src="./assets/index.8ce7c652.js"></script>
10+
<link rel="modulepreload" href="./assets/vendor.69f34422.js">
11+
<link rel="stylesheet" href="./assets/index.f5a643ec.css">
1112
</head>
1213
<body>
1314
<div id="app"></div>

src/App.vue

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ElOption
1616
v-for="item in typeOptions"
1717
:key="item.value"
18-
:label="item.label"
18+
:label="item.label + '(' + item.value + ')'"
1919
:value="item.value"
2020
>
2121
</ElOption>
@@ -31,7 +31,11 @@
3131
</ElFormItem>
3232

3333
<ElFormItem label="内容">
34-
<ElInput v-model="body" type="textarea"></ElInput>
34+
<ElInput
35+
v-model="body"
36+
type="textarea"
37+
:rows="10"
38+
></ElInput>
3539
</ElFormItem>
3640

3741
<!-- <ElFormItem label="最后">
@@ -40,15 +44,6 @@
4044
</ElForm>
4145

4246
<div class="py-2">
43-
<div class="pb-2 text-right">
44-
<ElButton
45-
type="primary"
46-
class="w-40"
47-
@click="handleCreate"
48-
>生成</ElButton
49-
>
50-
</div>
51-
5247
<div class="pb-2">
5348
<ElInput
5449
v-model="content"
@@ -61,6 +56,7 @@
6156
<ElButton
6257
type="success"
6358
class="w-40"
59+
:disabled="copyDisabled"
6460
@click="copy(content)"
6561
><span v-if="!copied">复制</span>
6662
<span v-else>已复制</span></ElButton
@@ -72,7 +68,7 @@
7268
</div>
7369
</template>
7470
<script setup lang="ts">
75-
import { ref } from "vue";
71+
import { ref, computed } from "vue";
7672
import {
7773
ElRow,
7874
ElCol,
@@ -113,18 +109,6 @@ const typeOptions = ref([
113109
value: "test",
114110
label: "增加 更新测试",
115111
},
116-
{
117-
value: "build",
118-
label: "构建变动",
119-
},
120-
{
121-
value: "ci",
122-
label: "继承变动",
123-
},
124-
{
125-
value: "revert",
126-
label: "回滚提交",
127-
},
128112
]);
129113
// 类型
130114
const type = ref("feat");
@@ -139,12 +123,25 @@ const body = ref("");
139123
// 最后
140124
const footer = ref("");
141125
142-
const content = ref("");
126+
const content = computed(() => {
127+
let commit = "";
128+
commit += type.value;
129+
if (scope.value) {
130+
commit += "(" + scope.value + ")";
131+
}
132+
commit += ":" + subject.value;
143133
134+
if (body.value) {
135+
commit += "\r\n\r\n" + body.value + "\r\n\r\n";
136+
}
137+
return commit;
138+
});
139+
const copyDisabled = computed((): boolean => {
140+
return type.value && subject.value ? false : true;
141+
});
144142
const { text, copy, copied, isSupported } = useClipboard({
145143
source: content,
146144
});
147-
148145
const handleCreate = () => {};
149146
</script>
150147
<style lang="less" scoped>

0 commit comments

Comments
 (0)