💩 脑测样式&逻辑代码

This commit is contained in:
目棃
2024-03-22 17:14:37 +08:00
parent 1405b544be
commit b5a81503a8
4 changed files with 121 additions and 31 deletions

View File

@@ -85,6 +85,9 @@ async function displayBox(
data.text = params.text ?? "";
data.mode = params.mode ?? "confirm";
data.otcancel = params.otcancel ?? true;
if (params.mode === "input" && params.input) {
inputVal.value = params.input;
}
show.value = true;
// 等待确认框关闭返回关闭后的confirmVal
return await new Promise<string | boolean | undefined>((resolve) => {

View File

@@ -42,21 +42,30 @@
<img :src="card.forum.icon" :alt="card.forum.name" />
<span>{{ card.forum.name }}</span>
</div>
<!-- todo 需要测试 -->
<div v-if="props.selectMode" class="tpc-select">
<v-checkbox-btn v-model="selectedList" :value="props.modelValue.post.post_id" />
</div>
</v-card>
</template>
<script lang="ts" setup>
import { onBeforeMount, ref } from "vue";
import { computed, onBeforeMount, ref } from "vue";
import { createPost } from "../../utils/TGWindow";
import TpAvatar from "../post/tp-avatar.vue";
interface TPostCardProps {
modelValue: TGApp.Plugins.Mys.Post.FullData;
selectMode?: boolean;
selected?: string[];
}
const props = defineProps<TPostCardProps>();
const props = withDefaults(defineProps<TPostCardProps>(), {
selectMode: false,
});
const isAct = ref<boolean>(false);
const card = ref<TGApp.Plugins.Mys.News.RenderCard>();
const selectedList = computed(() => props.selected);
onBeforeMount(() => {
card.value = getPostCard(props.modelValue);
@@ -224,6 +233,15 @@ function getPostCard(item: TGApp.Plugins.Mys.Post.FullData): TGApp.Plugins.Mys.N
color: var(--tgc-white-1);
}
.tpc-select {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}
.tpc-forum img {
width: 20px;
height: 20px;