FnShareSheet.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <share-sheet
  3. teleport="#app"
  4. v-model:show="internalShow"
  5. :title="t('立即分享给好友')"
  6. :options="options"
  7. @select="handleSelect"
  8. />
  9. </template>
  10. <script setup>
  11. import { useI18n } from "@/i18n";
  12. const { t } = useI18n();
  13. import { ShareSheet } from "vant";
  14. import { computed } from "vue";
  15. const props = defineProps({
  16. show: {
  17. type: Boolean,
  18. default: false,
  19. },
  20. options: {
  21. type: Array,
  22. default: () => [
  23. { name: "飞鸟用户", icon: "https://birdseye-img.sysuimars.com/birdseye-look-mini/Group%201321316260.png" ,type: "birdseye"},
  24. { name: "微信", icon: "wechat", type: "wechat" },
  25. ],
  26. },
  27. });
  28. const emit = defineEmits(["update:show", "select"]);
  29. const internalShow = computed({
  30. get() {
  31. return props.show;
  32. },
  33. set(val) {
  34. emit("update:show", val);
  35. },
  36. });
  37. function handleSelect(option) {
  38. emit("update:show", false);
  39. emit("select", option);
  40. }
  41. </script>
  42. <style scoped>
  43. </style>