|
@@ -48,7 +48,7 @@ const currentValue = ref(Math.round(props.initialValue || props.min))
|
|
|
const totalUnits = computed(() => Math.round((props.max - props.min) / props.step))
|
|
const totalUnits = computed(() => Math.round((props.max - props.min) / props.step))
|
|
|
|
|
|
|
|
|
|
|
|
|
-const extraGridCount = Math.ceil((uni?.getSystemInfoSync?.().windowWidth || 375) / props.gutter)
|
|
|
|
|
|
|
+const extraGridCount = Math.ceil((uni?.getSystemInfoSync?.().windowWidth || 375) / props.gutter / 2) * 2
|
|
|
|
|
|
|
|
const gridList = ref<GridItem[]>([])
|
|
const gridList = ref<GridItem[]>([])
|
|
|
const totalWidth = ref(0)
|
|
const totalWidth = ref(0)
|
|
@@ -59,7 +59,7 @@ function buildGrid() {
|
|
|
const count = totalUnits.value
|
|
const count = totalUnits.value
|
|
|
const arr: GridItem[] = []
|
|
const arr: GridItem[] = []
|
|
|
for (let i = 0; i <= count + extraGridCount * 1; i++) {
|
|
for (let i = 0; i <= count + extraGridCount * 1; i++) {
|
|
|
- const numIndex = i - extraGridCount /2
|
|
|
|
|
|
|
+ const numIndex = i - extraGridCount / 2
|
|
|
const num = props.min + numIndex * props.step
|
|
const num = props.min + numIndex * props.step
|
|
|
const displayNum = num
|
|
const displayNum = num
|
|
|
const isLongGrid = (numIndex % 10 === 0)
|
|
const isLongGrid = (numIndex % 10 === 0)
|