资源优化
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user