feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
Deploy to GitHub Pages / deploy (push) Failing after 16s
Regression / regression (push) Failing after 15m2s

This commit is contained in:
aurora-admin
2026-09-12 14:18:41 +08:00
parent 16f365a045
commit c65a69c34e
401 changed files with 22932 additions and 140 deletions
+39
View File
@@ -0,0 +1,39 @@
<template>
<div class="aa-carousel">
<div class="aa-carousel-track" :style="{ transform: `translateX(-${index * 100}%)` }">
<div class="aa-carousel-slide" v-for="(s, i) in items" :key="i" :style="{ background: s.color }">{{ s.text }}</div>
</div>
<button class="aa-carousel-arrow prev" @click="go(index - 1)">‹</button>
<button class="aa-carousel-arrow next" @click="go(index + 1)">›</button>
<div class="aa-carousel-dots">
<span class="aa-carousel-dot" v-for="(s, i) in items" :key="i"
:class="{ 'is-active': i === index }" @click="go(i)"></span>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue';
const props = defineProps({
items: { type: Array, default: () => [] },
autoplay: { type: Boolean, default: true },
interval: { type: Number, default: 3000 }
});
const index = ref(0);
let timer = null;
function go(i) {
const len = props.items.length || 1;
index.value = (i + len) % len;
restart();
}
function restart() {
if (timer) clearInterval(timer);
if (props.autoplay && props.items.length > 1) {
timer = setInterval(() => go(index.value + 1), props.interval);
}
}
onMounted(restart);
onBeforeUnmount(() => { if (timer) clearInterval(timer); });
</script>
<style src="./Carousel.css"></style>