mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-25 05:29:45 +08:00
♻️ use opener instead of window.open/shell
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<script lang="ts" setup>
|
||||
import TMiImg from "@comp/app/t-mi-img.vue";
|
||||
import showSnackbar from "@comp/func/snackbar.js";
|
||||
import { openUrl } from "@tauri-apps/plugin-opener";
|
||||
import { computed, toRaw } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
@@ -62,7 +63,7 @@ async function toLink(): Promise<void> {
|
||||
showSnackbar.error(`未知链接:${link}`, 3000);
|
||||
return;
|
||||
}
|
||||
window.open(res);
|
||||
await openUrl(res);
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import showSnackbar from "@comp/func/snackbar.js";
|
||||
import { openUrl } from "@tauri-apps/plugin-opener";
|
||||
import { onMounted, ref, shallowRef, StyleValue, toRaw } from "vue";
|
||||
|
||||
import { parseLink, parsePost } from "@/utils/linkParser.js";
|
||||
@@ -107,7 +108,7 @@ async function toLink(): Promise<void> {
|
||||
showSnackbar.error(`未知链接:${link}`, 3000);
|
||||
return;
|
||||
}
|
||||
window.open(res);
|
||||
await openUrl(res);
|
||||
}
|
||||
|
||||
// 解析表情链接
|
||||
|
||||
Reference in New Issue
Block a user