fs-avatar-group.vue 673 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="fs-avatar-group"><slot></slot></view>
  3. </template>
  4. <script>
  5. /**
  6. * 头像组组件
  7. * @description 头像组组件
  8. * @property {Number} margin 头像之间间隔
  9. * @property {Boolean} border 是否展示边框
  10. */
  11. export default {
  12. name: 'fs-avatar-group'
  13. }
  14. </script>
  15. <script setup>
  16. import { provide, computed } from 'vue'
  17. const props = defineProps({
  18. margin: {
  19. type: Number,
  20. default: '-30'
  21. },
  22. border: Boolean
  23. })
  24. const marginLeft = computed(() => -props.margin + 'rpx')
  25. provide('avatarGroup', props)
  26. </script>
  27. <style lang="scss" scoped>
  28. .fs-avatar-group {
  29. margin-left: v-bind(marginLeft);
  30. }
  31. </style>