no message

Former-commit-id: 63f4d371a0260677bd44db8ceb3af004a8373261 [formerly 63f4d371a0260677bd44db8ceb3af004a8373261 [formerly 63f4d371a0260677bd44db8ceb3af004a8373261 [formerly 63f4d371a0260677bd44db8ceb3af004a8373261 [formerly f7182f859150a21635c09cc195c7148601755e5f [formerly 7dd89561de98b79fb315b8f0d74a9b3c929ddf4e]]]]]
Former-commit-id: 2a7c572d32164c0130da45c457dbe4fcac92a6e1
Former-commit-id: 00c962387af18e9da0f79968947afbb8fe2fa232
Former-commit-id: 8ce5585bb9b4929547c39f441d0a3a8684ac9547 [formerly 9658f3b1f02bd0bab471a7d7c0355e99dba1f2fd]
Former-commit-id: 0ebad305d4c39c6c5a4f2ad1b7f37f27710deddd
Former-commit-id: d78960ee0093d1569ac932aefa186124f0ab7201
Former-commit-id: 0f71d88c24af1f5b2ec8cf90ece46f7338fdd73a
Former-commit-id: 485c45130570d9af769afd96e17275cddf6dff6a
Former-commit-id: ab2275efbe91fbc8545a2177d74bf7f850d69d44
This commit is contained in:
liyang
2018-06-19 13:32:01 +08:00
parent 640319e8d9
commit c42ad45923
6 changed files with 97 additions and 5 deletions

View File

@@ -0,0 +1,68 @@
<template>
<div class="d2-container-full" :style="cardStyle">
<div v-if="$slots.header" class="d2-container-full__header" ref="header">
<slot name="header"/>
</div>
<div class="d2-container-full__body" :style="bodyStyle">
<slot/>
</div>
<div v-if="$slots.footer" class="d2-container-full__footer" ref="footer">
<slot name="footer"/>
</div>
</div>
</template>
<script>
export default {
name: 'd2-container-full',
props: {
// 定位 上 右 下 左
top: {
type: Number,
required: false,
default: 0
},
right: {
type: Number,
required: false,
default: 0
},
bottom: {
type: Number,
required: false,
default: 0
},
left: {
type: Number,
required: false,
default: 0
}
},
data () {
return {
headerHeight: 0,
footerHeight: 0
}
},
mounted () {
this.headerHeight = this.$slots.header ? this.$refs.header.offsetHeight : 0
this.footerHeight = this.$slots.footer ? this.$refs.footer.offsetHeight : 0
},
computed: {
cardStyle () {
return {
top: `${this.top}px`,
right: `${this.right}px`,
bottom: `${this.bottom}px`,
left: `${this.left}px`
}
},
bodyStyle () {
return {
top: `${this.headerHeight}px`,
bottom: `${this.footerHeight}px`
}
}
}
}
</script>

View File

@@ -20,6 +20,7 @@
</template>
<script>
import d2ContainerFull from './components/d2-container-full.vue'
export default {
name: 'd2-container',
props: {
@@ -37,7 +38,7 @@ export default {
}
},
components: {
'd2-container-full': () => import('../d2-container-full/index.vue')
'd2-container-full': d2ContainerFull
}
}
</script>