forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQPage.js
More file actions
39 lines (38 loc) · 801 Bytes
/
QPage.js
File metadata and controls
39 lines (38 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export default {
name: 'QPage',
inject: {
pageContainer: {
default () {
console.error('QPage needs to be child of QPageContainer')
}
},
layout: {}
},
props: {
padding: Boolean
},
computed: {
computedStyle () {
const offset =
(this.layout.header.space ? this.layout.header.size : 0) +
(this.layout.footer.space ? this.layout.footer.size : 0)
return {
minHeight: offset ? `calc(100vh - ${offset}px)` : '100vh'
}
},
computedClass () {
if (this.padding) {
return 'layout-padding'
}
}
},
render (h) {
return h('main', {
staticClass: 'q-layout-page',
style: this.computedStyle,
'class': this.computedClass
}, [
this.$slots.default
])
}
}