Files
mes-ui-d2/src/components/core/d2-container/index.vue
liyang c42ad45923 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
2018-06-19 13:32:01 +08:00

74 lines
1.7 KiB
Vue

<template>
<div class="container-component" :class="{responsive}">
<!-- [card] 卡片容器 -->
<el-card v-if="type === 'card'" shadow="never" class="d2-container-card d2-mr d2-mb">
<slot v-if="$slots.header" name="header" slot="header"/>
<slot/>
</el-card>
<!-- [ghost] 隐形的容器 -->
<div v-if="type === 'ghost'" class="d2-mr d2-mb">
<slot name="header"/>
<slot/>
</div>
<!-- [container-full] 撑满 -->
<d2-container-full v-if="type === 'full'" :right="20" :bottom="0">
<slot v-if="$slots.header" name="header" slot="header"/>
<slot/>
<slot v-if="$slots.footer" name="footer" slot="footer"/>
</d2-container-full>
</div>
</template>
<script>
import d2ContainerFull from './components/d2-container-full.vue'
export default {
name: 'd2-container',
props: {
// 容器样式
type: {
type: String,
required: false,
default: 'card'
},
// 是否开启响应式尺寸变化
responsive: {
type: Boolean,
required: false,
default: false
}
},
components: {
'd2-container-full': d2ContainerFull
}
}
</script>
<style lang="scss">
@import '~@/assets/style/public.scss';
.container-component {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
overflow: auto;
}
@media (min-width: 576px) {
// 根据你的需要在这里添加样式
}
@media (min-width: 768px) {
// 根据你的需要在这里添加样式
}
@media (min-width: 992px) {
// 根据你的需要在这里添加样式
}
// 在大于1920分辨率的时候
@media (min-width: 1921px) {
.container-component.responsive {
margin: 0px auto;
margin-bottom: 20px;
max-width: 1920px - 200px;
}
}
</style>