forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQPageContainer.js
More file actions
41 lines (39 loc) · 970 Bytes
/
QPageContainer.js
File metadata and controls
41 lines (39 loc) · 970 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
40
41
export default {
name: 'QPageContainer',
inject: {
layout: {
default () {
console.error('QPageContainer needs to be child of QLayout')
}
}
},
provide: {
pageContainer: true
},
computed: {
computedStyle () {
const css = {}
if (this.layout.header.space) {
css.paddingTop = `${this.layout.header.size}px`
}
if (this.layout.right.space) {
css[`padding${this.$q.i18n.rtl ? 'Left' : 'Right'}`] = `${this.layout.right.size}px`
}
if (this.layout.footer.space) {
css.paddingBottom = `${this.layout.footer.size}px`
}
if (this.layout.left.space) {
css[`padding${this.$q.i18n.rtl ? 'Right' : 'Left'}`] = `${this.layout.left.size}px`
}
return css
}
},
render (h) {
return h('div', {
staticClass: 'q-layout-page-container q-layout-transition',
style: this.computedStyle
}, [
this.$slots.default
])
}
}