feat(scrollbar): max-height

This commit is contained in:
07akioni 2019-08-07 14:57:34 +08:00
parent 64f23686b2
commit 349f8b5450
4 changed files with 12 additions and 6 deletions

View File

@ -16,7 +16,7 @@
</n-scrollbar>
</div>
<div style="width: 400px; height: 300px;">
<n-scrollbar>
<n-scrollbar :max-height="200">
<div style="background: linear-gradient(red, blue); width: 400px; height: 500px;">
666
</div>

View File

@ -135,10 +135,6 @@ export default {
name: 'Select',
path: '/n-select'
},
{
name: 'Cascader',
path: '/n-cascader'
},
{
name: 'MultipleLabels',
path: '/n-MultipleLabels'

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "0.2.78",
"version": "0.2.79",
"description": "",
"main": "index.js",
"scripts": {

View File

@ -1,6 +1,9 @@
<template>
<div
class="n-scrollbar"
:style="maxHeight === null ? {} : {
maxHeight: maxHeight + 'px'
}"
@mouseenter="enterScrollWrapper"
@mouseleave="leaveScrollWrapper"
@dragstart.capture="handleDragStart"
@ -8,6 +11,9 @@
<div
ref="scrollContainer"
class="n-scrollbar-container"
:style="maxHeight === null ? {} : {
maxHeight: maxHeight + 'px'
}"
@scroll="handleScroll"
>
<div
@ -71,6 +77,10 @@ export default {
duration: {
type: Number,
default: 0
},
maxHeight: {
type: Number,
default: null
}
},
data () {