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:
@@ -67,23 +67,27 @@ 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">
|
||||||
<FitView />
|
<slot name="icon-fit-view">
|
||||||
</slot>
|
<FitView />
|
||||||
</ControlButton>
|
</slot>
|
||||||
</slot>
|
</ControlButton>
|
||||||
<slot name="control-interactive">
|
</slot>
|
||||||
<ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler">
|
</template>
|
||||||
<slot name="icon-unlock">
|
<template v-if="showInteractive">
|
||||||
<Unlock v-if="isInteractive" />
|
<slot name="control-interactive">
|
||||||
</slot>
|
<ControlButton v-if="showInteractive" class="vue-flow__controls-interactive" @click="onInteractiveChangeHandler">
|
||||||
<slot name="icon-lock">
|
<slot name="icon-unlock">
|
||||||
<Lock v-if="!isInteractive" />
|
<Unlock v-if="isInteractive" />
|
||||||
</slot>
|
</slot>
|
||||||
</ControlButton>
|
<slot name="icon-lock">
|
||||||
</slot>
|
<Lock v-if="!isInteractive" />
|
||||||
|
</slot>
|
||||||
|
</ControlButton>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user