im-ui-mobile 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,12 +24,16 @@
24
24
  <slot name="avatar">
25
25
  <view class="im-cell__avatar-container">
26
26
  <image v-if="avatar" :src="avatar" class="im-cell__avatar-image" mode="aspectFill" />
27
- <text v-else class="im-cell__avatar-fallback">
28
- {{ avatarFallback }}
29
- </text>
30
27
  </view>
31
28
  </slot>
32
29
  </view>
30
+ <view v-else-if="showAvatarFallback" class="im-cell__avatar">
31
+ <view class="im-cell__avatar-container">
32
+ <text class="im-cell__avatar-fallback">
33
+ {{ avatarFallback }}
34
+ </text>
35
+ </view>
36
+ </view>
33
37
 
34
38
  <!-- 标题和描述 -->
35
39
  <view class="im-cell__content">
@@ -117,6 +121,7 @@ interface Props {
117
121
  icon?: string
118
122
  iconPosition?: IconPosition
119
123
  avatar?: string
124
+ showAvatarFallback?: boolean
120
125
  title?: string
121
126
  titleSize?: TitleSize
122
127
  description?: string
@@ -150,6 +155,7 @@ const props = withDefaults(defineProps<Props>(), {
150
155
  hover: true,
151
156
  clickable: true,
152
157
  iconPosition: 'left',
158
+ showAvatarFallback: false,
153
159
  titleSize: 'medium',
154
160
  descriptionSize: 'small',
155
161
  arrow: false,
@@ -5,33 +5,33 @@
5
5
  :label="label" :badge="badge" :padding="padding" :margin="margin" :bgColor="bgColor" :textColor="textColor"
6
6
  @click="handleCellClick" @longpress="handleLongPress">
7
7
  <!-- 传递所有插槽 -->
8
- <template v-if="slots.icon" #icon>
8
+ <!-- <template v-if="icon || $slots.icon" #icon>
9
9
  <slot name="icon" />
10
10
  </template>
11
11
 
12
- <template v-if="slots.avatar" #avatar>
12
+ <template v-if="avatar || $slots.avatar" #avatar>
13
13
  <slot name="avatar" />
14
14
  </template>
15
15
 
16
- <template v-if="slots.title" #title>
16
+ <template v-if="title || $slots.title" #title>
17
17
  <slot name="title" />
18
18
  </template>
19
19
 
20
- <template v-if="slots.description" #description>
20
+ <template v-if="description || $slots.description" #description>
21
21
  <slot name="description" />
22
22
  </template>
23
23
 
24
- <template v-if="slots.arrow" #arrow>
24
+ <template v-if="arrow || $slots.arrow" #arrow>
25
25
  <slot name="arrow" />
26
26
  </template>
27
27
 
28
- <template v-if="slots.label" #label>
28
+ <template v-if="label || $slots.label" #label>
29
29
  <slot name="label" />
30
30
  </template>
31
31
 
32
- <template v-if="slots.badge" #badge>
32
+ <template v-if="badge || $slots.badge" #badge>
33
33
  <slot name="badge" />
34
- </template>
34
+ </template> -->
35
35
 
36
36
  <!-- 自定义右侧内容,添加 Switch -->
37
37
  <template #value>
@@ -45,11 +45,9 @@
45
45
  </template>
46
46
 
47
47
  <script setup lang="ts">
48
- import { ref, computed, watch, useSlots } from 'vue'
48
+ import { ref, computed, watch } from 'vue'
49
49
  import ImCell from '../im-cell/im-cell.vue'
50
50
 
51
- const slots = useSlots()
52
-
53
51
  // 定义 Props 接口
54
52
  interface Props {
55
53
  // 继承自 ImCell 的 Props
@@ -73,6 +71,7 @@ interface Props {
73
71
  margin?: string
74
72
  bgColor?: string
75
73
  textColor?: string
74
+ arrow?: boolean
76
75
 
77
76
  // Switch 特有 Props
78
77
  checked?: boolean
@@ -107,7 +106,8 @@ const props = withDefaults(defineProps<Props>(), {
107
106
  switchColor: '#409EFF',
108
107
  switchBackgroundColor: '#DCDFE6',
109
108
  loading: false,
110
- async: false
109
+ async: false,
110
+ arrow: false
111
111
  })
112
112
 
113
113
  const emit = defineEmits<Emits>()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "im-ui-mobile",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "description": "A Vue3.0 + Typescript instant messaging component library for Uniapp",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -13,6 +13,7 @@ declare interface CellProps {
13
13
  icon?: string
14
14
  iconPosition?: 'left' | 'right'
15
15
  avatar?: string
16
+ showAvatarFallback?: boolean
16
17
  title?: string
17
18
  titleSize?: 'small' | 'medium' | 'large'
18
19
  description?: string