mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
code refactor
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import Clipboard from 'clipboard';
|
||||
|
||||
import { ThemeType } from '@/core/theme.ts';
|
||||
|
||||
import { type AmountColor, PresetAmountColor } from '@/core/color.ts';
|
||||
@@ -76,6 +78,12 @@ export function setExpenseAndIncomeAmountColor(expenseAmountColorType: number, i
|
||||
}
|
||||
}
|
||||
|
||||
export function copyTextToClipboard(text: string, container?: Element | null): void {
|
||||
Clipboard.copy(text, {
|
||||
container: container || document.body
|
||||
});
|
||||
}
|
||||
|
||||
export function startDownloadFile(fileName: string, fileData: Blob): void {
|
||||
const dataObjectUrl = URL.createObjectURL(fileData);
|
||||
const dataLink = document.createElement('a');
|
||||
|
||||
Reference in New Issue
Block a user