5454 </span >
5555 <input v-if =" editingResourceState.get(item.id)" v-model =" newResourceName" class =" name-input"
5656 @blur =" saveResourceName(item)" @keyup.enter =" saveResourceName(item)" />
57- <span >{{ item.path }}</span >
57+ <span >
58+ {{ item.path }}
59+ </span >
5860 </span >
59- <button class =" delete-button" @click =" deleteRow(item.id)" title =" 删除" >
60- <svg xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 24 24" fill =" currentColor" width =" 16"
61- height =" 16" >
62- <path
63- d =" M9 3v1H4v2h16V4h-5V3H9zM5 7v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V7H5zm4 2h2v8H9V9zm4 0h2v8h-2V9z" />
64- </svg >
65- </button >
61+ <Press class =" press" theme =" outline" size =" 19" @click =" openPath(item)" />
62+ <el-popconfirm title =" 确定要删除吗?" confirm-button-text =" 确认" cancel-button-text =" 取消"
63+ @confirm =" deleteRow(item.id)" >
64+ <template #reference >
65+ <button class =" delete-button" title =" 删除" >
66+ <svg xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 24 24" fill =" currentColor" width =" 16"
67+ height =" 16" >
68+ <path
69+ d =" M9 3v1H4v2h16V4h-5V3H9zM5 7v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V7H5zm4 2h2v8H9V9zm4 0h2v8h-2V9z" />
70+ </svg >
71+ </button >
72+ </template >
73+ </el-popconfirm >
74+
6675 </div >
6776 </div >
6877 <button class =" launch-button" :disabled =" isLaunching" @click =" launch" >
@@ -88,6 +97,7 @@ import { invoke } from "@tauri-apps/api/core";
8897import { useToast } from " vue-toastification" ;
8998import { platform } from ' @tauri-apps/plugin-os'
9099import { ref , reactive , onMounted , nextTick , onBeforeMount } from ' vue' ;
100+ import { Press } from ' @icon-park/vue-next' ;
91101
92102export default {
93103 props: {
@@ -96,6 +106,9 @@ export default {
96106 required: true , // 确保传入数据
97107 },
98108 },
109+ components: {
110+ Press
111+ },
99112 setup (props , { emit }) {
100113 const toast = useToast ()
101114 // 控制下拉菜单的显示
@@ -206,6 +219,10 @@ export default {
206219 isLaunching .value = false ; // 恢复按钮状态
207220 }
208221 };
222+ const openPath = async (item ) => {
223+ await invoke (" open_path" , { path: item .path });
224+ toast .success (item .name + " 已打开!" );
225+ };
209226 const showAddUrlDialog = () => {
210227 showDialog .value = true ; // 打开添加网址的对话框
211228 dropdownVisible .value = false ; // 关闭下拉菜单
@@ -269,7 +286,8 @@ export default {
269286 closeDialog,
270287 moveLauncher,
271288 debounce,
272- debouncedLaunch
289+ debouncedLaunch,
290+ openPath
273291 };
274292 }
275293};
@@ -521,4 +539,21 @@ hr {
521539.mo-launcher {
522540 font-size : 18px ;
523541}
542+
543+ .press {
544+ transition : transform 0.3s ease , fill 0.3s ease ;
545+ color : #a19797 ;
546+ }
547+
548+ .press :hover {
549+ transform : scale (1.05 );
550+ color : #218838 ;
551+ }
552+
553+ .press :active {
554+ /* 点击时更深的绿色 */
555+ color : #1e7e34 ;
556+ /* 点击时缩小效果 */
557+ transform : scale (0.95 );
558+ }
524559 </style >
0 commit comments