allow MapZoom parent to get svg size data

This commit is contained in:
axolotle
2021-06-11 14:49:48 +02:00
parent e367e9d735
commit 88f866afe3
+3
View File
@@ -21,6 +21,7 @@ export default {
name: 'MapZoom',
props: {
value: { type: Object, default: () => ({ width: undefined, height: undefined }) },
id: { type: String, required: true },
minZoom: { type: Number, default: 0.3 },
maxZoom: { type: Number, default: 1 }
@@ -49,6 +50,7 @@ export default {
updateSize () {
const { width, height } = this.$el.getBoundingClientRect()
Object.assign(this.$data, { width, height })
this.$emit('input', { width, height })
},
onZoom (direction) {
@@ -76,6 +78,7 @@ export default {
position: relative;
width: 100%;
height: 100%;
cursor: grab;
svg {
width: 100%;