mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-16 09:58:13 +08:00
✨ 支持 post&anno share
This commit is contained in:
48
src/components/main/t-shareBtn.vue
Normal file
48
src/components/main/t-shareBtn.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div class="share-box">
|
||||
<div class="share-btn" @click="shareContent()">
|
||||
<v-icon style="color:var(--theme-switch-icon)">
|
||||
mdi-share-variant
|
||||
</v-icon>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// utils
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
|
||||
interface TShareBtnProps {
|
||||
modelValue: HTMLElement;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const props = defineProps<TShareBtnProps>();
|
||||
|
||||
async function shareContent () {
|
||||
await generateShareImg(props.title, props.modelValue);
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.share-box {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
border: var(--theme-switch-icon) 2px solid;
|
||||
}
|
||||
|
||||
.share-box:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.share-btn {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 5px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user