File tree Expand file tree Collapse file tree 3 files changed +39
-17
lines changed
Expand file tree Collapse file tree 3 files changed +39
-17
lines changed Original file line number Diff line number Diff line change 1+ - 新增黑色模式 跟随utools
2+ - 修改快捷键 改为了 ctrl+shift+c
3+ - 修复非必填项判断的问题
4+
5+ 一个简单 git Commit Message 书写的表单工具。
Original file line number Diff line number Diff line change 1010 <NButton @click="theme = null">浅色</NButton> -->
1111</template >
1212<script setup lang="ts">
13- import { ref } from " vue" ;
14- // import {
15- // NConfigProvider,
16- // NMessageProvider,
17- // NCard,
18- // NButton,
19- // darkTheme,
20- // } from "naive-ui";
13+ import { ref , onMounted } from " vue" ;
14+ import { darkTheme } from " naive-ui" ;
2115import Home from " ./components/home2.vue" ;
2216const theme = ref (null );
17+ const loadFunc = () => {
18+ if (utools .isDarkColors ()) {
19+ theme .value = darkTheme ;
20+ } else {
21+ theme .value = null ;
22+ }
23+ };
24+ let utools = null ;
25+ if (window [" utools" ]) {
26+ utools = window [" utools" ];
27+ utools .onPluginReady (() => {
28+ console .log (" 插件装配完成,已准备好" );
29+ loadFunc ();
30+ });
31+ utools .onPluginEnter (({ code , type , payload }) => {
32+ loadFunc ();
33+ });
34+ }
2335 </script >
24-
Original file line number Diff line number Diff line change 11
22
33<template >
4- <NCard :bordered =" false" >
4+ <NCard :bordered =" false" class = " card-class " >
55 <NGrid cols =" 24" item-responsive responsive =" screen" >
66 <NGridItem span =" 24 m:12 l:12" offset =" 0 m:6 l:6" >
77 <NSpace vertical >
3737 <NInput
3838 v-model:value =" scope"
3939 size =" large"
40- placeholder =" 范围"
40+ placeholder =" 范围(非必填) "
4141 ></NInput
4242 ></NGridItem >
4343 </NGrid >
4444 <NInput
4545 v-model:value =" subject"
4646 size =" large"
47- placeholder =" 简短描述"
47+ placeholder =" 简短描述(必填) "
4848 ></NInput >
4949
5050 <NInput
5151 v-model:value =" body"
5252 type =" textarea"
5353 :rows =" 10"
5454 size =" large"
55- placeholder =" 具体内容"
55+ placeholder =" 具体内容(非必填) "
5656 ></NInput >
5757 </NSpace >
58- <NText depth =" 3" >ctrl + alt 快速复制并关闭 </NText >
58+ <NText depth =" 3" >Ctrl + Shift + C 快速复制并关闭 </NText >
5959 <!-- <ElFormItem label="最后">
6060 <NInput v-model="footer" type="textarea"></NInput>
6161 </ElFormItem> -->
@@ -82,7 +82,7 @@ import { useClipboard, useMagicKeys } from "@vueuse/core";
8282const message = useMessage ();
8383
8484const keys = useMagicKeys ();
85- const shiftCtrlC = keys [" Ctrl+Alt " ];
85+ const shiftCtrlC = keys [" Ctrl+Shift+C " ];
8686
8787watch (shiftCtrlC , (v ) => {
8888 if (v ) {
@@ -177,7 +177,8 @@ onMounted(() => {
177177 }
178178});
179179const handleCopy = async () => {
180- if (! scope .value ) {
180+ if (! subject .value ) {
181+ message .error (" 必填项必填" );
181182 return ;
182183 }
183184 let content = handleGetContent ();
@@ -188,4 +189,9 @@ const handleCopy = async () => {
188189 });
189190};
190191 </script >
191-
192+ <style scoped>
193+ .card-class {
194+ width : 100% ;
195+ height : 100vh ;
196+ }
197+ </style >
You can’t perform that action at this time.
0 commit comments