share.vue
930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<div>
<van-overlay
:show="showOverlay"
@click="showOverlay = false"
:z-index="100000"
>
<span class="icon icon-share"></span>
<p class="tip">“点击右上角转发/分享”</p>
</van-overlay>
<slot></slot>
</div>
</template>
<script>
import { ref, defineComponent } from "vue";
export default defineComponent({
name: "SharePage",
props: {
isShowOverlay: {
type: Boolean,
default: false,
},
},
setup(props) {
const showOverlay = ref(false);
const share = () => {
showOverlay.value = true;
};
if (props.isShowOverlay) {
showOverlay.value = true;
}
return {
showOverlay,
share,
};
},
});
</script>
<style lang="scss" scoped>
.icon-share {
position: absolute;
top: 20px;
right: 65px;
}
.tip {
margin-top: 105px;
text-align: center;
color: #fff;
font-size: 16px;
}
</style>