Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | 7x 7x 7x 7x 7x | <template>
<div :class="$style.root" v-on="$listeners" :shadow="shadow" :border="border" :split="split"
:style="{width: /^\d+$/.test(width)? width+'px': width}" :designer="$env.VUE_APP_DESIGNER">
<f-scroll-view :class="$style.scrollview" :native="$env.VUE_APP_DESIGNER">
<div :class="$style.cover" vusion-slot-name="cover">
<slot name="cover"></slot>
<s-empty v-if="coverSlot && (!$slots.cover) && !!$attrs['vusion-node-path']"></s-empty>
</div>
<div :class="$style.head">
<slot name="head">
<div :class="$style.title" vusion-slot-name="title" vusion-slot-name-edit="title">
<slot name="title">
{{ title }}
<s-empty
v-if="!$slots.title
&& !title
&& $env.VUE_APP_DESIGNER
&& !!$attrs['vusion-node-path']">
</s-empty>
</slot>
</div>
<a :class="$style.close" @click="cancel()"></a>
<div :class="$style.extra">
<slot name="extra"></slot>
</div>
</slot>
</div>
<div :class="$style.body" vusion-slot-name="default">
<slot>{{ content }}</slot>
<s-empty v-if="(!$slots.default) && $env.VUE_APP_DESIGNER && !!$attrs['vusion-node-path']"></s-empty>
</div>
<div :class="$style.foot">
<slot name="foot">
</slot>
</div>
</f-scroll-view>
</div>
</template>
<script>
import SEmpty from '../s-empty.vue';
export default {
name: 'u-card',
components: {
SEmpty,
},
props: {
title: String,
content: String,
shadow: { type: String, default: 'always' },
border: { type: Boolean, default: true },
split: { type: Boolean, default: false },
width: { type: [String, Number], default: '' },
// 控制模板占位插槽的显示
coverSlot: { type: Boolean, default: false },
},
};
</script>
<style module>
.root {
border-radius: var(--card-border-radius);
background: var(--card-background);
overflow: hidden;
}
.root[shadow="always"] {
box-shadow: var(--card-box-shadow);
}
.root[shadow="hover"]:hover {
box-shadow: var(--card-box-shadow-hover);
}
.root[shadow="always"],
.root[shadow="hover"] {
transition: box-shadow var(--transition-duration-base);
}
.root[shadow="never"] {
box-shadow: none;
}
.root[split] .head {
border-bottom: var(--card-border-width) solid var(--border-color-base);
padding-bottom: var(--card-head-padding-y);
}
.root[border] {
border: var(--card-border-width) solid var(--border-color-base);
}
.root[designer] {
word-break: break-all;
white-space: normal;
}
.root[designer] [s-empty="true"] {
min-width: inherit;
}
.cover {
padding: 0;
}
.cover > * {
vertical-align: middle;
}
.head {
position: relative;
padding: var(--card-head-padding-y) var(--card-head-padding-x) 0 var(--card-head-padding-x);
}
.title {
margin: 0;
font-size: var(--card-title-font-size);
font-weight: var(--card-title-font-weight);
}
.extra {
position: absolute;
right: var(--card-head-padding-x);
top: var(--card-head-padding-y);
}
.body {
clear: both;
padding: var(--card-body-padding-y) var(--card-body-padding-x);
}
.scrollview {
height: 100%;
}
</style>
|