短文配图:快发盒上传 + Twitter 式网格 + 全站 lightbox 预览;整卡点击进详情、时间线短文豁免首字
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { sanitizeHtml } from '../../utils'
|
||||
import { openLightbox } from '../../lightbox'
|
||||
import CommentSection from '../../components/comments/CommentSection.vue'
|
||||
|
||||
// 余白文章页。对应设计稿 viewPost() 的三栏「纸」:
|
||||
@@ -168,6 +169,23 @@ function onTocClick(e) {
|
||||
|
||||
<div class="prose" :class="{ 'prose-note': isShort }" v-html="sanitizeHtml(props.contentHtml)" />
|
||||
|
||||
<!-- 短文配图:Twitter 式网格(快发盒上传);点图开预览 -->
|
||||
<div
|
||||
v-if="isShort && props.post.images && props.post.images.length"
|
||||
class="post-imgs"
|
||||
:class="'n' + Math.min(props.post.images.length, 4)"
|
||||
>
|
||||
<img
|
||||
v-for="(u, i) in props.post.images.slice(0, 4)"
|
||||
:key="i"
|
||||
:src="u"
|
||||
alt=""
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
@click="openLightbox(props.post.images, i)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="end">
|
||||
<RouterLink v-for="t in props.post.tags || []" :key="t" class="tg" to="/tags">{{ t }}</RouterLink>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user