Files
mes-ui-d2/src/components/core/d2-container/index.vue
liyang 5be1a01af0 no message
Former-commit-id: 1b47ade5d828ebd21cebf89733b330736fdb9b0a [formerly 1b47ade5d828ebd21cebf89733b330736fdb9b0a [formerly 1b47ade5d828ebd21cebf89733b330736fdb9b0a [formerly 1b47ade5d828ebd21cebf89733b330736fdb9b0a [formerly 815ebd019df4898f6020d8a83c626a62001855c5 [formerly ad017ce82a45ca26f9a2b7b83e12d3eaf0fa2202]]]]]
Former-commit-id: dd760fabf7dfdb920b55dbe6eb2e23d233abcace
Former-commit-id: d3f075eb4089bff2280d5374a6e3bbde964b8de5
Former-commit-id: c1648a260eea51bbcc9d1db788956b36f695c8ec [formerly 040f6f8fddb1f012d147fdfa6c49d2a57a656049]
Former-commit-id: 15d06ac27ea41b02dd1e4e08f29bab0d24ab351c
Former-commit-id: 53d2d63810676b38897c4d9ceeccb8b8bcc1e937
Former-commit-id: 15896299c57ca870257c3a78f581ea0b600808e1
Former-commit-id: 54e400274ca4c13982c8eedbc2cef86489d20e93
Former-commit-id: 3286aa286ac48f6ea4ed06bc67f0cf29de70fd38
2018-06-20 10:45:01 +08:00

74 lines
1.7 KiB
Vue

<template>
<div class="container-component" :class="{responsive}">z
<!-- [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'">
<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>