docs: fix Grid demo slider tooltip (#39275)

* docs: fix Grid demo slider tooltip

* docs: fix Grid demo slider tooltip

* docs: fix Grid demo slider tooltip
This commit is contained in:
PisecesPeng 2022-12-06 00:23:29 +08:00 committed by GitHub
parent 6bb9dbc692
commit 25d9ee096b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { Col, Row, Slider } from 'antd';
const gutters: Record<string, number> = {};
const vgutters: Record<string, number> = {};
const colCounts: Record<string, number> = {};
const gutters: Record<PropertyKey, number> = {};
const vgutters: Record<PropertyKey, number> = {};
const colCounts: Record<PropertyKey, number> = {};
[8, 16, 24, 32, 40, 48].forEach((value, i) => {
gutters[i] = value;
@ -43,7 +43,7 @@ const App: React.FC = () => {
onChange={setGutterKey}
marks={gutters}
step={null}
tooltip={{ formatter: (value) => value && gutters[value] }}
tooltip={{ formatter: (value: number) => gutters[value] }}
/>
</div>
<span>Vertical Gutter (px): </span>
@ -55,7 +55,7 @@ const App: React.FC = () => {
onChange={setVgutterKey}
marks={vgutters}
step={null}
tooltip={{ formatter: (value) => value && vgutters[value] }}
tooltip={{ formatter: (value: number) => vgutters[value] }}
/>
</div>
<span>Column Count:</span>
@ -67,7 +67,7 @@ const App: React.FC = () => {
onChange={setColCountKey}
marks={colCounts}
step={null}
tooltip={{ formatter: (value) => value && colCounts[value] }}
tooltip={{ formatter: (value: number) => colCounts[value] }}
/>
</div>
<Row gutter={[gutters[gutterKey], vgutters[vgutterKey]]}>