mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
💄 调整帖子卡片颜色,对于宽度不低于690的图片进行铺满
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-card rounded v-if="card">
|
||||
<v-card :rounded="true" v-if="card">
|
||||
<div class="tpc-cover">
|
||||
<img :src="card.cover" alt="cover" @click="createPost(card)" />
|
||||
<div v-if="isAct" class="tpc-act">
|
||||
@@ -100,19 +100,19 @@ onBeforeMount(() => {
|
||||
const EnumStatus = {
|
||||
STARTED: {
|
||||
status: "进行中",
|
||||
colorCss: "#1EE2BA",
|
||||
colorCss: "var(--tgc-od-green)",
|
||||
},
|
||||
FINISHED: {
|
||||
status: "已结束",
|
||||
colorCss: "#C0C5C8",
|
||||
colorCss: "var(--tgc-od-white)",
|
||||
},
|
||||
SELECTION: {
|
||||
status: "评选中",
|
||||
colorCss: "#FF983B",
|
||||
colorCss: "var(--tgc-od-orange)",
|
||||
},
|
||||
UNKNOWN: {
|
||||
status: "未知",
|
||||
colorCss: "#F03F24", // 胭脂红
|
||||
colorCss: "var(--tgc-od-red)",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<img :src="localUrl" :alt="props.data.insert.image" :title="getImageTitle()" />
|
||||
</div>
|
||||
<div v-else class="tp-image-load" :title="getImageUrl()">
|
||||
<v-progress-circular indeterminate color="primary" size="small" />
|
||||
<v-progress-circular :indeterminate="true" color="primary" size="small" />
|
||||
<span>加载中...</span>
|
||||
</div>
|
||||
<TpoImage :image="props.data" v-model="showOverlay" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { computed, ref, onMounted, onUnmounted } from "vue";
|
||||
|
||||
import { saveImgLocal } from "../../utils/TGShare.js";
|
||||
import { bytesToSize } from "../../utils/toolFunc.js";
|
||||
@@ -37,6 +37,12 @@ const props = defineProps<TpImageProps>();
|
||||
const showOverlay = ref(false);
|
||||
const localUrl = ref<string | undefined>(undefined);
|
||||
|
||||
const imgWidth = computed<string>(() => {
|
||||
if (props.data.attributes === undefined) return "auto";
|
||||
if (props.data.attributes.width >= 690) return "100%";
|
||||
return `${props.data.attributes.width}px`;
|
||||
});
|
||||
|
||||
console.log("tp-image", props.data.insert.image, props.data.attributes);
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -79,6 +85,7 @@ function getImageUrl(): string {
|
||||
}
|
||||
|
||||
.tp-image-box img {
|
||||
width: v-bind(imgWidth);
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
border-radius: 10px;
|
||||
|
||||
Reference in New Issue
Block a user