2022-01-09 07:15:23 +01:00
|
|
|
<template>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-card
|
|
|
|
v-bind="$attrs"
|
|
|
|
:class="classes"
|
|
|
|
class="v-card--material pa-3"
|
|
|
|
>
|
2021-08-06 16:28:12 -08:00
|
|
|
<div class="d-flex grow flex-wrap">
|
|
|
|
<slot name="avatar">
|
|
|
|
<v-sheet
|
|
|
|
:color="color"
|
|
|
|
:max-height="icon ? 90 : undefined"
|
|
|
|
:width="icon ? 'auto' : '100%'"
|
|
|
|
elevation="6"
|
|
|
|
class="text-start v-card--material__heading mb-n6 mt-n10 pa-7"
|
|
|
|
dark
|
|
|
|
>
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-icon
|
|
|
|
v-if="icon"
|
|
|
|
size="40"
|
|
|
|
>
|
|
|
|
{{ icon }}
|
|
|
|
</v-icon>
|
|
|
|
<div
|
|
|
|
v-if="text"
|
|
|
|
class="headline font-weight-thin"
|
|
|
|
v-text="text"
|
|
|
|
/>
|
2021-08-06 16:28:12 -08:00
|
|
|
</v-sheet>
|
|
|
|
</slot>
|
|
|
|
|
2025-06-20 00:09:12 +07:00
|
|
|
<div
|
|
|
|
v-if="$slots['after-heading']"
|
|
|
|
class="ml-auto"
|
|
|
|
>
|
2021-08-06 16:28:12 -08:00
|
|
|
<slot name="after-heading" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<slot />
|
|
|
|
|
|
|
|
<template v-if="$slots.actions">
|
|
|
|
<v-divider class="mt-2" />
|
|
|
|
|
|
|
|
<v-card-actions class="pb-0">
|
|
|
|
<slot name="actions" />
|
|
|
|
</v-card-actions>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-if="$slots.bottom">
|
2025-06-20 00:09:12 +07:00
|
|
|
<v-divider
|
|
|
|
v-if="!$slots.actions"
|
|
|
|
class="mt-2"
|
|
|
|
/>
|
2021-08-06 16:28:12 -08:00
|
|
|
|
|
|
|
<div class="pb-0">
|
|
|
|
<slot name="bottom" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</v-card>
|
|
|
|
</template>
|
|
|
|
|
2022-01-09 07:15:23 +01:00
|
|
|
<script lang="ts">
|
2025-06-20 00:09:12 +07:00
|
|
|
export default defineNuxtComponent({
|
2021-08-06 16:28:12 -08:00
|
|
|
name: "MaterialCard",
|
|
|
|
|
|
|
|
props: {
|
|
|
|
avatar: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
color: {
|
|
|
|
type: String,
|
|
|
|
default: "primary",
|
|
|
|
},
|
|
|
|
icon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined,
|
|
|
|
},
|
|
|
|
image: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
},
|
2022-01-09 07:15:23 +01:00
|
|
|
setup() {
|
2025-06-20 00:09:12 +07:00
|
|
|
const { $vuetify } = useNuxtApp();
|
2022-01-09 07:15:23 +01:00
|
|
|
const hasHeading = computed(() => false);
|
|
|
|
const hasAltHeading = computed(() => false);
|
|
|
|
const classes = computed(() => {
|
2021-08-06 16:28:12 -08:00
|
|
|
return {
|
2022-01-09 07:15:23 +01:00
|
|
|
"v-card--material--has-heading": hasHeading,
|
2025-06-20 00:09:12 +07:00
|
|
|
"mt-3": $vuetify.display.name.value === "xs" || $vuetify.display.name.value === "sm",
|
2021-08-06 16:28:12 -08:00
|
|
|
};
|
2022-01-09 07:15:23 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
hasHeading,
|
|
|
|
hasAltHeading,
|
|
|
|
classes,
|
|
|
|
};
|
2021-08-06 16:28:12 -08:00
|
|
|
},
|
2022-01-09 07:15:23 +01:00
|
|
|
});
|
2021-08-06 16:28:12 -08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass">
|
|
|
|
.v-card--material
|
|
|
|
&__avatar
|
|
|
|
position: relative
|
|
|
|
top: -64px
|
|
|
|
margin-bottom: -32px
|
|
|
|
|
|
|
|
&__heading
|
|
|
|
position: relative
|
|
|
|
top: -40px
|
|
|
|
transition: .3s ease
|
|
|
|
z-index: 1
|
|
|
|
</style>
|