update: add slots to Background.vue, Controls.vue and MiniMap.vue

This commit is contained in:
Braks
2021-10-20 22:39:54 +02:00
parent 6b4e7ab3ce
commit 1853c21353
5 changed files with 65 additions and 49 deletions
+18 -16
View File
@@ -74,22 +74,24 @@ const viewBox = computed(() => {
:viewBox="`${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}`"
class="revue-flow__minimap"
>
<template v-for="(node, i) of store.nodes" :key="`mini-map-node-${i}`">
<MiniMapNode
v-if="!node.isHidden"
:x="node.__rf.position.x"
:y="node.__rf.position.y"
:width="node.__rf.width"
:height="node.__rf.height"
:style="node.style"
:class="nodeClassNameFunc(node)"
:color="nodeColorFunc(node)"
:border-radius="props.nodeBorderRadius"
:stroke-color="nodeStrokeColorFunc(node)"
:stroke-width="props.nodeStrokeWidth"
:shape-rendering="shapeRendering"
/>
</template>
<slot name="mini-map-nodes" :nodes="store.nodes" :view-box="viewBox">
<template v-for="(node, i) of store.nodes" :key="`mini-map-node-${i}`">
<MiniMapNode
v-if="!node.isHidden"
:x="node.__rf.position.x"
:y="node.__rf.position.y"
:width="node.__rf.width"
:height="node.__rf.height"
:style="node.style"
:class="nodeClassNameFunc(node)"
:color="nodeColorFunc(node)"
:border-radius="props.nodeBorderRadius"
:stroke-color="nodeStrokeColorFunc(node)"
:stroke-width="props.nodeStrokeWidth"
:shape-rendering="shapeRendering"
/>
</template>
</slot>
<path
class="revue-flow__minimap-mask"
:d="`