docs: Update Table resize demo (#22165)

* update demo

* update snapshot
This commit is contained in:
二货机器人 2020-03-12 21:30:08 +08:00 committed by GitHub
parent a589b56a28
commit 6a563ff49c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 2 deletions

View File

@ -10400,9 +10400,63 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
/>
</th>
<th
class="ant-table-cell react-resizable"
class="ant-table-cell ant-table-column-has-sorters react-resizable"
>
Amount
<div
class="ant-table-column-sorters"
>
<span>
Amount
</span>
<span
class="ant-table-column-sorter ant-table-column-sorter-full"
>
<span
class="ant-table-column-sorter-inner"
>
<span
aria-label="caret-up"
class="anticon anticon-caret-up ant-table-column-sorter-up"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="caret-up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"
/>
</svg>
</span>
<span
aria-label="caret-down"
class="anticon anticon-caret-down ant-table-column-sorter-down"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="caret-down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 1024 1024"
width="1em"
>
<path
d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"
/>
</svg>
</span>
</span>
</span>
</div>
<span
class="react-resizable-handle react-resizable-handle-se"
style="touch-action:none"

View File

@ -28,6 +28,14 @@ const ResizeableTitle = props => {
<Resizable
width={width}
height={0}
handle={resizeHandle => (
<span
className={`react-resizable-handle react-resizable-handle-${resizeHandle}`}
onClick={e => {
e.stopPropagation();
}}
/>
)}
onResize={onResize}
draggableOpts={{ enableUserSelectHack: false }}
>
@ -48,6 +56,7 @@ class Demo extends React.Component {
title: 'Amount',
dataIndex: 'amount',
width: 100,
sorter: (a, b) => a.amount - b.amount,
},
{
title: 'Type',