增加公共分享组件
This commit is contained in:
28
components/ymf-components/ymf-share.vue
Normal file
28
components/ymf-components/ymf-share.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<view class="relative">
|
||||
<slot v-if="$slots.default" name="default"></slot>
|
||||
<up-icon v-else name="share-square" bold color="#333" size="36rpx"></up-icon>
|
||||
<view class="absolute share-box">
|
||||
<button open-type="share" @click="shareClick">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const emits = defineEmits(['shareClick'])
|
||||
|
||||
function shareClick() {
|
||||
emits('shareClick')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.share-box {
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user