refactor(vue-flow,components): hide/show slots in Controls.vue

# What's changed?

* depending on props, hide slot as well
* rename `control-fitview` to `control-fit-view`
This commit is contained in:
bcakmakoglu
2022-06-15 19:31:20 +02:00
committed by Braks
parent 14000111f9
commit 32086e0760
@@ -67,13 +67,16 @@ export default {
</ControlButton> </ControlButton>
</slot> </slot>
</template> </template>
<slot name="control-fitview"> <template v-if="showFitView">
<ControlButton v-if="showFitView" class="vue-flow__controls-fitview" @click="onFitViewHandler"> <slot name="control-fit-view">
<slot name="icon-fitview"> <ControlButton class="vue-flow__controls-fitview" @click="onFitViewHandler">
<slot name="icon-fit-view">
<FitView /> <FitView />
</slot> </slot>
</ControlButton> </ControlButton>
</slot> </slot>
</template>
<template v-if="showInteractive">
<slot name="control-interactive"> <slot name="control-interactive">
<ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler"> <ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler">
<slot name="icon-unlock"> <slot name="icon-unlock">
@@ -84,6 +87,7 @@ export default {
</slot> </slot>
</ControlButton> </ControlButton>
</slot> </slot>
</template>
<slot></slot> <slot></slot>
</div> </div>
</template> </template>