🚸 右键复制链接

This commit is contained in:
BTMuli
2025-08-20 12:15:19 +08:00
parent 21b34de208
commit 1de561dab0
4 changed files with 748 additions and 709 deletions

View File

@@ -89,9 +89,9 @@
"echarts": "^6.0.0",
"html2canvas": "^1.4.1",
"js-md5": "^0.8.3",
"jsencrypt": "^3.3.2",
"jsencrypt": "^3.5.4",
"pinia": "^3.0.3",
"pinia-plugin-persistedstate": "^4.4.1",
"pinia-plugin-persistedstate": "^4.5.0",
"qrcode.vue": "^3.6.0",
"sass-embedded": "^1.90.0",
"uuid": "^11.1.0",
@@ -99,7 +99,7 @@
"vue-echarts": "^7.0.3",
"vue-json-pretty": "^2.5.0",
"vue-router": "^4.5.1",
"vuetify": "^3.9.4",
"vuetify": "^3.9.5",
"wcag-color": "^1.1.1",
"xml-js": "^1.6.11"
},
@@ -111,10 +111,10 @@
"@types/color-convert": "^2.0.4",
"@types/fs-extra": "^11.0.4",
"@types/js-md5": "^0.8.0",
"@types/node": "^24.2.1",
"@types/node": "^24.3.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/parser": "^8.39.0",
"@typescript/native-preview": "7.0.0-dev.20250808.1",
"@typescript-eslint/parser": "^8.39.1",
"@typescript/native-preview": "7.0.0-dev.20250816.1",
"@vitejs/plugin-vue": "^6.0.1",
"concurrently": "^9.2.0",
"eslint": "^9.33.0",
@@ -128,7 +128,7 @@
"husky": "^9.1.7",
"jsonc-eslint-parser": "^2.4.0",
"lint-staged": "^16.1.5",
"oxlint": "^1.11.0",
"oxlint": "^1.12.0",
"prettier": "3.6.2",
"stylelint": "^16.23.1",
"stylelint-config-idiomatic-order": "^10.0.0",
@@ -139,10 +139,10 @@
"stylelint-order": "^7.0.0",
"stylelint-prettier": "^5.0.3",
"stylelint-scss": "^6.12.1",
"tsx": "^4.20.3",
"tsx": "^4.20.4",
"typescript": "^5.9.2",
"typescript-eslint": "^8.39.0",
"vite": "^7.1.1",
"typescript-eslint": "^8.39.1",
"vite": "^7.1.2",
"vite-plugin-vue-devtools": "^8.0.0",
"vite-plugin-vuetify": "^2.1.2",
"vue-eslint-parser": "^10.2.0",

1057
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

366
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@
v-if="mode == 'link'"
class="tp-text-link"
@click="toLink()"
@contextmenu="copyLink()"
:title="props.data.attributes?.link"
:style="getTextStyle()"
>
@@ -110,6 +111,19 @@ async function toLink(): Promise<void> {
await openUrl(res);
}
// 复制链接
async function copyLink(): Promise<void> {
if (!props.data.attributes) return;
if (!props.data.attributes.link) return;
const link = props.data.attributes.link;
try {
await navigator.clipboard.writeText(link);
showSnackbar.success("链接已复制到剪贴板");
} catch (e) {
showSnackbar.error(`复制链接失败: ${e}`, 3000);
}
}
// 解析表情链接
function getEmojiUrl(): string {
if (localEmojis.value === null || !JSON.parse(localEmojis.value)[getEmojiName()]) {