mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-17 04:46:46 +08:00
🎨 规范化代码
This commit is contained in:
@@ -103,7 +103,7 @@ function miniImgUrl(): string {
|
||||
}
|
||||
|
||||
function getImageTitle(): string {
|
||||
const res: string[] = [];
|
||||
const res: Array<string> = [];
|
||||
if (props.data.attributes) {
|
||||
res.push(`宽度:${props.data.attributes.width}px`);
|
||||
res.push(`高度:${props.data.attributes.height}px`);
|
||||
|
||||
@@ -57,11 +57,11 @@ type TpVillaCard = {
|
||||
owner_nickname: string;
|
||||
owner_avatar_url: string;
|
||||
villa_introduce?: string;
|
||||
tag_list?: string[];
|
||||
tag_list?: Array<string>;
|
||||
villa_member_num: string;
|
||||
is_official?: boolean;
|
||||
is_available: boolean;
|
||||
hot_member_avatar?: string[];
|
||||
hot_member_avatar?: Array<string>;
|
||||
hot_room?: VillaRoom;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -78,7 +78,7 @@ onMounted(async () => {
|
||||
const voteInfo = await ApiHubReq.vote.info(vote.id, vote.uid);
|
||||
console.log(`[${props.data.insert.vote.id}]voteInfo:`, voteInfo);
|
||||
const voteResult = await ApiHubReq.vote.result(vote.id, vote.uid);
|
||||
console.log("[${props.data.insert.vote.id}]voteResult:", voteResult);
|
||||
console.log(`[${props.data.insert.vote.id}]voteResult:`, voteResult);
|
||||
votes.value = {
|
||||
title: voteInfo.title,
|
||||
count: voteResult.user_cnt,
|
||||
|
||||
@@ -26,7 +26,7 @@ type TbCollectProps = { modelValue: number; data?: TGApp.BBS.Post.FullData };
|
||||
const props = defineProps<TbCollectProps>();
|
||||
const isCollected = ref<boolean>(false);
|
||||
const showEdit = ref<boolean>(false);
|
||||
const collect = shallowRef<Array<TGApp.Sqlite.UserCollection.UFMap>>([]);
|
||||
const collect = shallowRef<Array<TGApp.Sqlite.Collection.PcMap>>([]);
|
||||
|
||||
onBeforeMount(async () => await refresh());
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ const props = defineProps<ToPostCollectProps>();
|
||||
const emits = defineEmits<ToPostCollectEmits>();
|
||||
const visible = defineModel<boolean>();
|
||||
const submit = ref<boolean>(false);
|
||||
const collectList = shallowRef<Array<TGApp.Sqlite.UserCollection.UFCollection>>([]);
|
||||
const postCollect = shallowRef<Array<TGApp.Sqlite.UserCollection.UFMap>>([]);
|
||||
const collectList = shallowRef<Array<TGApp.Sqlite.Collection.Collection>>([]);
|
||||
const postCollect = shallowRef<Array<TGApp.Sqlite.Collection.PcMap>>([]);
|
||||
const selectList = shallowRef<Array<string>>([]);
|
||||
|
||||
watch(
|
||||
@@ -72,7 +72,7 @@ async function freshData(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteCollect(item: TGApp.Sqlite.UserCollection.UFCollection): Promise<void> {
|
||||
async function deleteCollect(item: TGApp.Sqlite.Collection.Collection): Promise<void> {
|
||||
const delCheck = await showDialog.check("确定删除分类?", "该分类若有帖子,则会变为未分类");
|
||||
if (!delCheck) {
|
||||
showSnackbar.cancel("取消删除");
|
||||
|
||||
Reference in New Issue
Block a user