Demo:小地图改为通过图片渲染
This commit is contained in:
parent
e85f187199
commit
8466a3e99f
@ -16,7 +16,9 @@
|
|||||||
left: svgBoxLeft + 'px',
|
left: svgBoxLeft + 'px',
|
||||||
top: svgBoxTop + 'px'
|
top: svgBoxTop + 'px'
|
||||||
}"
|
}"
|
||||||
></div>
|
>
|
||||||
|
<img :src="mindMapImg" @mousedown.prevent />
|
||||||
|
</div>
|
||||||
<div class="windowBox" :style="viewBoxStyle"></div>
|
<div class="windowBox" :style="viewBoxStyle"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -44,11 +46,12 @@ export default {
|
|||||||
top: 0,
|
top: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
right: 0
|
right: 0
|
||||||
}
|
},
|
||||||
|
mindMapImg: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['isDark']),
|
...mapState(['isDark'])
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$bus.$on('toggle_mini_map', this.toggle_mini_map)
|
this.$bus.$on('toggle_mini_map', this.toggle_mini_map)
|
||||||
@ -91,14 +94,16 @@ export default {
|
|||||||
|
|
||||||
drawMiniMap() {
|
drawMiniMap() {
|
||||||
let {
|
let {
|
||||||
svgHTML,
|
getImgUrl,
|
||||||
viewBoxStyle,
|
viewBoxStyle,
|
||||||
miniMapBoxScale,
|
miniMapBoxScale,
|
||||||
miniMapBoxLeft,
|
miniMapBoxLeft,
|
||||||
miniMapBoxTop
|
miniMapBoxTop
|
||||||
} = this.mindMap.miniMap.calculationMiniMap(this.boxWidth, this.boxHeight)
|
} = this.mindMap.miniMap.calculationMiniMap(this.boxWidth, this.boxHeight)
|
||||||
// 渲染到小地图
|
// 渲染到小地图
|
||||||
this.$refs.svgBox.innerHTML = svgHTML
|
getImgUrl(img => {
|
||||||
|
this.mindMapImg = img
|
||||||
|
})
|
||||||
this.viewBoxStyle = viewBoxStyle
|
this.viewBoxStyle = viewBoxStyle
|
||||||
this.svgBoxScale = miniMapBoxScale
|
this.svgBoxScale = miniMapBoxScale
|
||||||
this.svgBoxLeft = miniMapBoxLeft
|
this.svgBoxLeft = miniMapBoxLeft
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user