资源优化

This commit is contained in:
kron
2025-07-12 16:07:07 +08:00
parent 927ad523f2
commit c6e53453fb
6 changed files with 13 additions and 5 deletions

View File

@@ -14,12 +14,17 @@ const props = defineProps({
type: Array,
default: () => [],
},
onChange: {
type: Function,
default: (index) => {},
},
});
const currentIndex = ref(0);
const handleChange = (e) => {
currentIndex.value = e.detail.current;
props.onChange(e.detail.current);
};
</script>
@@ -81,10 +86,10 @@ const handleChange = (e) => {
width: 8px;
height: 8px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.5);
background-color: #ccc;
}
.dot.active {
background-color: #fff;
background-color: #000;
}
</style>