im-ui-mobile 0.0.11 → 0.0.13
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.
|
@@ -21,34 +21,48 @@
|
|
|
21
21
|
</view>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
|
-
<script setup
|
|
24
|
+
<script setup>
|
|
25
25
|
import { computed } from 'vue'
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
time: string
|
|
32
|
-
lastMessage: string
|
|
33
|
-
unreadCount?: number
|
|
34
|
-
}
|
|
27
|
+
// 设置组件名称(重要!)
|
|
28
|
+
defineOptions({
|
|
29
|
+
name: 'ImChatItem'
|
|
30
|
+
})
|
|
35
31
|
|
|
36
|
-
const props =
|
|
37
|
-
type:
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'default',
|
|
36
|
+
validator: (value) => ['default', 'group'].includes(value)
|
|
37
|
+
},
|
|
38
|
+
avatar: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ''
|
|
41
|
+
},
|
|
42
|
+
name: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true
|
|
45
|
+
},
|
|
46
|
+
time: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
lastMessage: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
unreadCount: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 0
|
|
57
|
+
}
|
|
40
58
|
})
|
|
41
59
|
|
|
42
|
-
const emit = defineEmits
|
|
43
|
-
click: [event: any]
|
|
44
|
-
}>()
|
|
60
|
+
const emit = defineEmits(['click'])
|
|
45
61
|
|
|
46
62
|
const displayName = computed(() => props.name.charAt(0))
|
|
47
|
-
const displayUnreadCount = computed(() =>
|
|
48
|
-
props.unreadCount > 99 ? '99+' : props.unreadCount
|
|
49
|
-
)
|
|
63
|
+
const displayUnreadCount = computed(() => props.unreadCount > 99 ? '99+' : props.unreadCount)
|
|
50
64
|
|
|
51
|
-
const handleClick = (event
|
|
65
|
+
const handleClick = (event) => {
|
|
52
66
|
console.log('🔍 uni 对象检查:', {
|
|
53
67
|
hasUni: typeof uni !== 'undefined',
|
|
54
68
|
hasShowToast: typeof uni?.showToast === 'function',
|
package/package.json
CHANGED
|
@@ -1,43 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
$emit: (event: "click", ...args: any[]) => void;
|
|
3
|
+
type: string;
|
|
4
|
+
avatar: string;
|
|
4
5
|
name: string;
|
|
5
6
|
time: string;
|
|
6
7
|
lastMessage: string;
|
|
7
|
-
unreadCount?: number;
|
|
8
|
-
}
|
|
9
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
|
-
type: string;
|
|
11
|
-
avatar: string;
|
|
12
8
|
unreadCount: number;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
onClick?: ((event: any) => any) | undefined;
|
|
21
|
-
}>, {
|
|
22
|
-
type: "default" | "group";
|
|
23
|
-
avatar: string;
|
|
24
|
-
unreadCount: number;
|
|
25
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
-
export default _default;
|
|
27
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
29
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
-
} : {
|
|
32
|
-
type: import('vue').PropType<T[K]>;
|
|
33
|
-
required: true;
|
|
9
|
+
$props: {
|
|
10
|
+
readonly type?: string | undefined;
|
|
11
|
+
readonly avatar?: string | undefined;
|
|
12
|
+
readonly name?: string | undefined;
|
|
13
|
+
readonly time?: string | undefined;
|
|
14
|
+
readonly lastMessage?: string | undefined;
|
|
15
|
+
readonly unreadCount?: number | undefined;
|
|
34
16
|
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
38
|
-
default: D[K];
|
|
39
|
-
}> : P[K];
|
|
40
|
-
};
|
|
41
|
-
type __VLS_Prettify<T> = {
|
|
42
|
-
[K in keyof T]: T[K];
|
|
43
|
-
} & {};
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|