mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
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:
parent
6bb9dbc692
commit
25d9ee096b
@ -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]]}>
|
||||
|
Loading…
Reference in New Issue
Block a user