更新页面效果
This commit is contained in:
@@ -243,6 +243,13 @@
|
||||
<button v-if="isFlexible(page.type) && page.images.length > 1"
|
||||
class="absolute -top-2 -right-2 w-5 h-5 rounded-full bg-[#a88c6b] text-white text-[10px] leading-none flex items-center justify-center shadow"
|
||||
@click="removeImage(page, iidx)" title="移除该图">✕</button>
|
||||
<!-- 排序:前移 / 后移 -->
|
||||
<button v-if="iidx > 0"
|
||||
class="absolute -bottom-2 left-1 w-5 h-5 rounded-full bg-white border border-[#a88c6b]/50 text-[#a88c6b] text-[10px] leading-none flex items-center justify-center shadow hover:bg-[#a88c6b] hover:text-white transition-colors"
|
||||
@click="moveImage(page, iidx, -1)" title="前移"><i class="fa-solid fa-arrow-left"></i></button>
|
||||
<button v-if="iidx < page.images.length - 1"
|
||||
class="absolute -bottom-2 right-1 w-5 h-5 rounded-full bg-white border border-[#a88c6b]/50 text-[#a88c6b] text-[10px] leading-none flex items-center justify-center shadow hover:bg-[#a88c6b] hover:text-white transition-colors"
|
||||
@click="moveImage(page, iidx, 1)" title="后移"><i class="fa-solid fa-arrow-right"></i></button>
|
||||
</div>
|
||||
<button v-if="isFlexible(page.type)"
|
||||
class="w-[96px] h-[96px] rounded-xl border border-dashed border-[#a88c6b]/40 text-[#a88c6b] text-[11px] flex items-center justify-center hover:border-[#a88c6b] transition-colors"
|
||||
@@ -396,6 +403,12 @@ function isFlexible(type) {
|
||||
}
|
||||
function addImage(page) { if (!Array.isArray(page.images)) page.images = []; page.images.push('') }
|
||||
function removeImage(page, i) { if (page.images.length > 1) page.images.splice(i, 1) }
|
||||
// 图片排序:前移(-1) / 后移(+1)
|
||||
function moveImage(page, i, dir) {
|
||||
const j = i + dir
|
||||
if (!Array.isArray(page.images) || j < 0 || j >= page.images.length) return
|
||||
const t = page.images[i]; page.images[i] = page.images[j]; page.images[j] = t
|
||||
}
|
||||
|
||||
// 相册页操作
|
||||
function addPage() { cfg.photoPages.push(ensurePageShape({ type: 'single', title: '新页面', subtitle: 'NEW', desc: '', img1: '' })) }
|
||||
|
||||
Reference in New Issue
Block a user