fix: code style

This commit is contained in:
dylanmay
2025-11-06 23:23:25 +08:00
parent 500ce9cf7c
commit 007bb2dd26
21 changed files with 116 additions and 105 deletions

View File

@@ -18,13 +18,15 @@ const SendFrom = {
User: 1,
} as const;
const getAvatar = (sendFrom: number) =>
sendFrom === SendFrom.User
function getAvatar(sendFrom: number) {
return sendFrom === SendFrom.User
? props.user.avatar
: preferences.app.defaultAvatar;
}
const getNickname = (sendFrom: SendFrom) =>
sendFrom === SendFrom.User ? props.user.nickname : '公众号';
function getNickname(sendFrom: SendFrom) {
return sendFrom === SendFrom.User ? props.user.nickname : '公众号';
}
</script>
<template>
<div class="execution" v-for="item in props.list" :key="item.id">

View File

@@ -60,7 +60,7 @@ onMounted(async () => {
});
// 执行发送
const sendMsg = async () => {
async function sendMsg() {
if (!unref(reply)) {
return;
}
@@ -85,14 +85,14 @@ const sendMsg = async () => {
// 发送后清空数据
replySelectRef.value?.clear();
};
}
const loadMore = () => {
function loadMore() {
queryParams.pageNo++;
getPage(queryParams, null);
};
}
const getPage = async (page: any, params: any = null) => {
async function getPage(page: any, params: any = null) {
loading.value = true;
const dataTemp = await getMessagePage(
Object.assign(
@@ -128,19 +128,19 @@ const getPage = async (page: any, params: any = null) => {
msgDivRef.value.scrollHeight - scrollHeight - 100;
}
}
};
}
const refreshChange = () => {
function refreshChange() {
getPage(queryParams);
};
}
/** 定位到消息底部 */
const scrollToBottom = async () => {
async function scrollToBottom() {
await nextTick();
if (msgDivRef.value) {
msgDivRef.value.scrollTop = msgDivRef.value.scrollHeight;
}
};
}
</script>
<template>