Files
mes-ui-d2/src/components/core/d2-container/index.vue
liyang bff410ca27 no message
Former-commit-id: f9b1dcc686e727bd5dd83b5764e2cd0983a344d4 [formerly f9b1dcc686e727bd5dd83b5764e2cd0983a344d4 [formerly f9b1dcc686e727bd5dd83b5764e2cd0983a344d4 [formerly f9b1dcc686e727bd5dd83b5764e2cd0983a344d4 [formerly d617d3a2cff891cb3530b6487b96e62fa1e9a56b [formerly 5ebd248c8e6fc71258f7497e6861e3b12df8ff4d]]]]]
Former-commit-id: 7e192fc2e8275d11d9dde20a25c24e208b92f330
Former-commit-id: 727b71a95c4c2dbcd2409f8d0bb129573ac2ba0d
Former-commit-id: 36cc1a9a946196ac72ddc572aa3a189e08435791 [formerly 0051ece832577f08d0b32be7de901bb8b8d9129e]
Former-commit-id: c88e08a200959269e97f2f29470cbfa57fe8ae3c
Former-commit-id: af64a81ea44b620eb5e88d95ca85fbe65981de22
Former-commit-id: 0f135d9be7792f9a8d38cf361ab834f880c11680
Former-commit-id: 66f0115189d29850594ba700159d2b6984174837
Former-commit-id: 0a7a4e24f9c494ce623f81a96ce0ecd36d076664
2018-06-19 14:08:21 +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>