FamilyEmptyState.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="family-empty-state" :class="['family-empty-' + type]">
  3. <view class="empty-icon">{{ iconChar }}</view>
  4. <view class="empty-title">{{ title }}</view>
  5. <view v-if="desc" class="empty-desc">{{ desc }}</view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. name: 'FamilyEmptyState',
  11. props: {
  12. type: { type: String, default: 'card' },
  13. title: { type: String, default: '暂无数据' },
  14. desc: { type: String, default: '' }
  15. },
  16. computed: {
  17. iconChar: function() {
  18. return this.type === 'card' ? '🏠' : '👨‍👩‍👧'
  19. }
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. .family-empty-state {
  25. display: flex;
  26. flex-direction: column;
  27. align-items: center;
  28. padding: 20rpx 16rpx;
  29. }
  30. .family-empty-card { padding: 24rpx 16rpx; }
  31. .family-empty-block { padding: 60rpx 24rpx; }
  32. .family-empty-list { padding: 40rpx 16rpx; }
  33. .empty-icon { font-size: 48rpx; margin-bottom: 12rpx; }
  34. .empty-title { font-size: 28rpx; color: #333; margin-bottom: 8rpx; }
  35. .empty-desc { font-size: 24rpx; color: #999; margin-bottom: 16rpx; }
  36. </style>