Skip to content

Commit 2945a61

Browse files
authored
Merge pull request #211 from rpocklin/feature/add-height-variable
Feature: add height variable to wrapper component
2 parents dce1ad0 + ae3511a commit 2945a61

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

attributes.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"type": ["string", "function"],
1616
"description": "String of HTML table selector or function returning HTML table string. Default: undefined"
1717
},
18+
"gridjs-vue/height": {
19+
"type": "string",
20+
"description": "String that sets the height of the table excluding search, pagination, etc. Default: undefined"
21+
},
1822
"gridjs-vue/language": {
1923
"type": "object",
2024
"description": "Localization dictionary object. Default: undefined"

src/gridjs-vue.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export default {
2828
type: [String, Function],
2929
default: undefined
3030
},
31+
height: {
32+
type: [String],
33+
default: undefined
34+
},
3135
language: {
3236
type: Object,
3337
default: undefined
@@ -87,13 +91,12 @@ export default {
8791
autoWidth: this.autoWidth,
8892
columns: this.cols ? this.cols : [this.dict.error.columnsUndefined],
8993
data: this.rows ? this.rows : this.from || this.server ? undefined : [[this.dict.error.rowsUndefined]],
94+
height: this.height,
9095
pagination: this.pagination,
9196
sort: this.sort,
9297
width: this.width
9398
}
9499
95-
// let classNames
96-
97100
if (this.classNames) options.className = this.classNames
98101
if (this.from)
99102
options.from =
@@ -121,6 +124,9 @@ export default {
121124
from() {
122125
this.update()
123126
},
127+
height() {
128+
this.update()
129+
},
124130
language() {
125131
this.update()
126132
},

0 commit comments

Comments
 (0)