mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
feat(scrollbar): max-height
This commit is contained in:
parent
64f23686b2
commit
349f8b5450
@ -16,7 +16,7 @@
|
|||||||
</n-scrollbar>
|
</n-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 400px; height: 300px;">
|
<div style="width: 400px; height: 300px;">
|
||||||
<n-scrollbar>
|
<n-scrollbar :max-height="200">
|
||||||
<div style="background: linear-gradient(red, blue); width: 400px; height: 500px;">
|
<div style="background: linear-gradient(red, blue); width: 400px; height: 500px;">
|
||||||
666
|
666
|
||||||
</div>
|
</div>
|
||||||
|
@ -135,10 +135,6 @@ export default {
|
|||||||
name: 'Select',
|
name: 'Select',
|
||||||
path: '/n-select'
|
path: '/n-select'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Cascader',
|
|
||||||
path: '/n-cascader'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'MultipleLabels',
|
name: 'MultipleLabels',
|
||||||
path: '/n-MultipleLabels'
|
path: '/n-MultipleLabels'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "naive-ui",
|
"name": "naive-ui",
|
||||||
"version": "0.2.78",
|
"version": "0.2.79",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="n-scrollbar"
|
class="n-scrollbar"
|
||||||
|
:style="maxHeight === null ? {} : {
|
||||||
|
maxHeight: maxHeight + 'px'
|
||||||
|
}"
|
||||||
@mouseenter="enterScrollWrapper"
|
@mouseenter="enterScrollWrapper"
|
||||||
@mouseleave="leaveScrollWrapper"
|
@mouseleave="leaveScrollWrapper"
|
||||||
@dragstart.capture="handleDragStart"
|
@dragstart.capture="handleDragStart"
|
||||||
@ -8,6 +11,9 @@
|
|||||||
<div
|
<div
|
||||||
ref="scrollContainer"
|
ref="scrollContainer"
|
||||||
class="n-scrollbar-container"
|
class="n-scrollbar-container"
|
||||||
|
:style="maxHeight === null ? {} : {
|
||||||
|
maxHeight: maxHeight + 'px'
|
||||||
|
}"
|
||||||
@scroll="handleScroll"
|
@scroll="handleScroll"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -71,6 +77,10 @@ export default {
|
|||||||
duration: {
|
duration: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
maxHeight: {
|
||||||
|
type: Number,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
Loading…
Reference in New Issue
Block a user