共1个回答
OI
游客oiHIeZ

可以这样做:

js

import { VariableSizeList as List } from 'react-window';
import cx from 'classnames';

import styles from './ololo.module.scss';

// ...

<List className={cx(styles.customScrollBar)}>
  {Message}
</List>

scss


.customScrollBar { overflow-y: scroll; &::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); background-color: #f5f5f5; } &::-webkit-scrollbar { width: 6px; background-color: #f5f5f5; } &::-webkit-scrollbar-thumb { background-color: #6e6e6e; border-radius: 3px; } }