* 显示截屏成功的 Toast
(imageData: string)
| 81 | * 显示截屏成功的 Toast |
| 82 | */ |
| 83 | function showSuccessToast(imageData: string) { |
| 84 | lastCapturedImage = imageData |
| 85 | |
| 86 | toast.add({ |
| 87 | title: '截图已复制到剪贴板', |
| 88 | color: 'primary', |
| 89 | actions: [ |
| 90 | { |
| 91 | label: '预览截图', |
| 92 | icon: 'i-heroicons-eye', |
| 93 | onClick: () => { |
| 94 | if (lastCapturedImage) { |
| 95 | layoutStore.openScreenCaptureModal(lastCapturedImage) |
| 96 | } |
| 97 | }, |
| 98 | }, |
| 99 | { |
| 100 | label: '保存', |
| 101 | icon: 'i-heroicons-arrow-down-tray', |
| 102 | onClick: () => { |
| 103 | if (lastCapturedImage) { |
| 104 | downloadImage(lastCapturedImage) |
| 105 | } |
| 106 | }, |
| 107 | }, |
| 108 | ], |
| 109 | }) |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * 捕获指定选择器的元素 |
no test coverage detected