| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <script>
- export default {
- name: 'UiSectionCard',
- inheritAttrs: true,
- props: {
- title: {
- type: String,
- default: ''
- },
- shadow: {
- type: String,
- default: 'never'
- }
- }
- }
- </script>
- <template>
- <!-- 透传 Element Card 属性与组件事件;布局样式仅作用于当前卡片的直接子节点。 -->
- <el-card class="ng-ui-section-card" :shadow="shadow" v-bind="$attrs" v-on="$listeners">
- <template v-if="title || $slots.header || $scopedSlots.header" slot="header">
- <slot name="header">
- <h2 class="ng-ui-section-card-title">{{ title }}</h2>
- </slot>
- </template>
- <slot />
- </el-card>
- </template>
- <style lang="scss" scoped>
- .ng-ui-section-card {
- margin-bottom: 24px;
- border-radius: 8px;
- }
- .ng-ui-section-card-title {
- margin: 0;
- color: #202259;
- font-size: 16px;
- font-weight: 700;
- line-height: 1.5;
- }
- .ng-ui-section-card ::v-deep > .el-card__header {
- margin: 0 24px;
- padding: 22px 0 14px;
- }
- .ng-ui-section-card ::v-deep > .el-card__body {
- padding: 24px 24px 4px;
- }
- @media (max-width: 767px) {
- .ng-ui-section-card {
- margin-bottom: 24px;
- }
- .ng-ui-section-card ::v-deep > .el-card__header {
- margin: 0 16px;
- }
- .ng-ui-section-card ::v-deep > .el-card__body {
- padding: 20px 16px 0;
- }
- }
- </style>
|