소스 검색

allow MapZoom parent to get svg size data

axolotle 3 년 전
부모
커밋
88f866afe3
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/components/layouts/MapZoom.vue

+ 3 - 0
src/components/layouts/MapZoom.vue

@@ -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%;