mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 20:12:48 +00:00
29 lines
744 B
Vue
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>
|