修改自定义轮播显示

v1.2.0
于肖磊 2025-01-08 16:13:08 +08:00
parent ec440182a4
commit ffbead8c02
2 changed files with 8 additions and 6 deletions

View File

@ -190,9 +190,6 @@ watchEffect(() => {
const data_source_carousel_col = Number(form.value.data_source_carousel_col);
//
slides_per_group.value = new_style.value.rolling_fashion == 'translation' ? 1 : Number(data_source_carousel_col);
//
const col = data_source_content_list.value.length > Number(data_source_carousel_col) ? Number(data_source_carousel_col) : data_source_content_list.value.length;
slides_per_view.value = col;
let num = 0;
//
if (!isEmpty(data_source_content_list.value)) {
@ -202,7 +199,11 @@ watchEffect(() => {
//
if (form.value.data_source_direction == 'horizontal') {
swiper_height.value = props.dataHeight * custom_scale.value + padding_top + padding_bottom + margin_bottom + margin_top;
slides_per_view.value = Number(data_source_carousel_col);
} else {
//
const col = data_source_content_list.value.length > Number(data_source_carousel_col) ? Number(data_source_carousel_col) : data_source_content_list.value.length;
slides_per_view.value = col;
swiper_height.value = (props.dataHeight * custom_scale.value + padding_top + padding_bottom + margin_bottom + margin_top) * col + ((data_source_carousel_col - 1) * space_between.value);
}
dot_list.value = Array(num);

View File

@ -169,9 +169,6 @@ watchEffect(() => {
const data_source_carousel_col = Number(form.value.data_source_carousel_col);
//
slides_per_group.value = new_style.value.rolling_fashion == 'translation' ? 1 : Number(data_source_carousel_col);
//
const col = data_source_content_list.value.length > Number(data_source_carousel_col) ? Number(data_source_carousel_col) : data_source_content_list.value.length;
slides_per_view.value = col;
let num = 0;
//
if (!isEmpty(data_source_content_list.value)) {
@ -181,8 +178,12 @@ watchEffect(() => {
//
if (form.value.data_source_direction == 'horizontal') {
swiper_height.value = form.value.height * scale.value + padding_top + padding_bottom + margin_bottom + margin_top;
slides_per_view.value = Number(data_source_carousel_col);
} else {
//
const col = data_source_content_list.value.length > Number(data_source_carousel_col) ? Number(data_source_carousel_col) : data_source_content_list.value.length;
swiper_height.value = (form.value.height * scale.value + padding_top + padding_bottom + margin_bottom + margin_top) * col + ((data_source_carousel_col - 1) * space_between.value);
slides_per_view.value = col;
}
dot_list.value = Array(num);
// key