cartodb-4.42/lib/assets/javascripts/new-dashboard/components/MapCard/MapCard.vue

46 lines
940 B
Vue
Raw Normal View History

2024-04-06 13:25:13 +08:00
<template>
<component
:is="componentType"
:visualization="visualization"
:isSelected="isSelected"
:canHover="canHover"
:selectMode="selectMode"
:storeActionType="storeActionType"
@toggleSelection="toggleSelection"
@contentChanged="onContentChanged" />
</template>
<script>
import CondensedMapCard from './CondensedMapCard';
import SimpleMapCard from './SimpleMapCard';
import props from './shared/props';
export default {
name: 'MapCard',
props: {
...props,
condensed: {
type: Boolean,
default: false
}
},
components: {
SimpleMapCard,
CondensedMapCard
},
computed: {
componentType () {
return this.condensed ? 'CondensedMapCard' : 'SimpleMapCard';
}
},
methods: {
toggleSelection ($event) {
this.$emit('toggleSelection', $event);
},
onContentChanged (type) {
this.$emit('contentChanged', type);
}
}
};
</script>