2024-11-09 08:35:14 +08:00

29 lines
744 B
Vue

<template>
<div class="content-location no-dark-content">
<div class="location-title">{{msg.title}}</div>
<div v-if="msg.address" class="location-address">{{msg.address}}</div>
<div class="location-preview" :style="imageStyle(msg)"></div>
</div>
</template>
<script>
export default {
props: {
msg: Object,
},
methods: {
imageStyle({width, height, thumb}) {
if (!thumb) {
return {};
}
const style = {
backgroundImage: `url(${thumb})`,
}
if (width && height) {
style.backgroundSize = `${width}px ${height}px`;
}
return style;
}
}
}
</script>