ScrollPanel
Um contêiner de rolagem com as barras finas do próprio tema, sobre a rolagem nativa — as mesmas barras de todo componente que rola por dentro, e que o v-scrollbar coloca numa caixa sua.
Importação
import { ScrollPanel } from '@vitral/vue';Vertical e horizontal
Paragraph 1. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 2. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 3. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 4. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 5. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 6. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 7. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Paragraph 8. Vitral draws the scrollbars of this panel with the theme's tokens, while the browser keeps doing the scrolling, so the wheel, touch, and the arrow and page keys all work as they do anywhere else.
Quando as barras aparecem
`scrollbar` é `'hover'` por padrão: as barras aparecem enquanto o ponteiro está sobre o painel, o foco está dentro dele ou ele rola. `'always'` as mantém na tela, e `'native'` devolve as do navegador. `arrows` coloca setas nas pontas delas, como numa barra nativa. A mesma prop está em todo componente que rola por dentro (Sidebar, Select, Dialog, Drawer, DataGrid e os demais), e a opção `scrollbar` da aplicação define todas de uma vez. Só o polegar recebe o ponteiro: um clique na faixa chega ao conteúdo embaixo dela.
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
- Item 6
- Item 7
- Item 8
- Item 9
- Item 10
- Item 11
- Item 12
- Item 13
- Item 14
- Item 15
- Item 16
- Item 17
- Item 18
- Item 19
- Item 20
- Item 21
- Item 22
- Item 23
- Item 24
Conteúdo que cresce
As barras acompanham o conteúdo, além do painel: uma seção que abre com animação, uma imagem que carrega.
The bar is measured again when what is inside grows, not only when the panel does: open the section and its thumb shrinks while the section is still opening.
Caixas suas
`v-scrollbar` coloca as mesmas barras numa caixa sua que já rola, sem embrulhá-la: ela mantém o lugar no layout e a rolagem nativa. `v-scrollbar.always`, `.hover` e `.native`, ou um valor, dizem quando elas aparecem; sem nenhum, decide a opção `scrollbar` da aplicação. `.arrows` coloca setas nas pontas, como numa barra nativa — um clique rola um passo, segurar continua rolando —, e a opção `scrollbarArrows` da aplicação faz o mesmo em todas as barras.
Student 1
Student 2
Student 3
Student 4
Student 5
Student 6
Student 7
Student 8
Student 9
Student 10
Student 11
Student 12
Student 13
Student 14
Student 15
Student 16
Student 17
Student 18
Student 19
Student 20
| Student 1 | 6.0 |
| Student 2 | 6.7 |
| Student 3 | 7.4 |
| Student 4 | 8.1 |
| Student 5 | 8.8 |
| Student 6 | 9.5 |
| Student 7 | 6.2 |
| Student 8 | 6.9 |
| Student 9 | 7.6 |
| Student 10 | 8.3 |
| Student 11 | 9.0 |
| Student 12 | 9.7 |
| Student 13 | 6.4 |
| Student 14 | 7.1 |
| Student 15 | 7.8 |
| Student 16 | 8.5 |
| Student 17 | 9.2 |
| Student 18 | 9.9 |
| Student 19 | 6.6 |
| Student 20 | 7.3 |
Student 1: grade 6.0, entered on the term's sheet
Student 2: grade 6.7, entered on the term's sheet
Student 3: grade 7.4, entered on the term's sheet
Student 4: grade 8.1, entered on the term's sheet
Student 5: grade 8.8, entered on the term's sheet
Student 6: grade 9.5, entered on the term's sheet
Student 7: grade 6.2, entered on the term's sheet
Student 8: grade 6.9, entered on the term's sheet
Student 9: grade 7.6, entered on the term's sheet
Student 10: grade 8.3, entered on the term's sheet
Student 11: grade 9.0, entered on the term's sheet
Student 12: grade 9.7, entered on the term's sheet
Student 13: grade 6.4, entered on the term's sheet
Student 14: grade 7.1, entered on the term's sheet
Student 15: grade 7.8, entered on the term's sheet
Student 16: grade 8.5, entered on the term's sheet
Student 17: grade 9.2, entered on the term's sheet
Student 18: grade 9.9, entered on the term's sheet
Student 19: grade 6.6, entered on the term's sheet
Student 20: grade 7.3, entered on the term's sheet
API
Lido de packages/vue/src/components/ScrollPanel/types.ts, então diz o que o componente aceita de fato.
Props
| Nome | Tipo | Descrição |
|---|---|---|
| arrows Novo na 0.2.16 | boolean | Setas nas pontas das barras, como numa barra nativa: um clique rola um passo e segurar continua rolando. Por padrão é a opção `scrollbarArrows` da aplicação, que vem desligada. |
| scrollbar | ScrollbarMode | As barras das caixas que este componente rola por dentro: `'hover'`, `'always'` ou `'native'`. Por padrão é a opção `scrollbar` da aplicação, que é `'hover'`. |
Mais pt, dt e unstyled de BaseProps; veja pass-through e modo sem estilo.
Slots
| Nome | Props do slot | Descrição |
|---|---|---|
| default | — | — |