support restore

This commit is contained in:
Julian Freeman
2026-01-19 12:18:08 -04:00
parent f96033e421
commit 6439759b04
2 changed files with 26 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useGalleryStore } from "../stores/gallery";
import { Settings, CheckSquare, Type, Palette, Copy, Eraser, PlusSquare, Brush, Sparkles, Trash2, RotateCw } from 'lucide-vue-next';
import { Settings, CheckSquare, Type, Palette, Copy, Eraser, PlusSquare, Brush, Sparkles, Trash2, RotateCw, RotateCcw } from 'lucide-vue-next';
import { computed } from "vue";
const store = useGalleryStore();
@@ -227,6 +227,15 @@ const applyAll = () => {
<Eraser class="w-5 h-5" />
执行移除
</button>
<button
v-if="store.selectedImage && store.selectedImage.path !== store.selectedImage.originalPath"
@click="store.selectedIndex >= 0 && store.restoreImage(store.selectedIndex)"
class="w-full bg-gray-700 hover:bg-gray-600 text-gray-300 py-2 rounded text-sm transition-colors flex items-center justify-center gap-2"
>
<RotateCcw class="w-4 h-4" />
还原原图
</button>
</div>
</div>