29 lines
456 B
Vue
29 lines
456 B
Vue
<template>
|
|
<div
|
|
v-if="user.banner_path"
|
|
class="bg-cover bg-center"
|
|
:style="setBackground()"
|
|
></div>
|
|
<div
|
|
v-else
|
|
class="bg-cover bg-center"
|
|
></div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
user: Object,
|
|
size: {
|
|
type: String,
|
|
default: 'small',
|
|
},
|
|
},
|
|
methods: {
|
|
setBackground() {
|
|
return `background-image: url(/img/${this.user.banner_path}?p=${this.size});`;
|
|
},
|
|
},
|
|
};
|
|
</script>
|