2018-11-14 16:26:00 +01:00
|
|
|
<template>
|
|
|
|
<div class="champs-editor">
|
|
|
|
<div v-if="state.typesDeChamp.length > 3" class="header">
|
|
|
|
<button class="button" @click.prevent="addChamp">
|
|
|
|
<template v-if="state.isAnnotation">
|
|
|
|
Ajouter une annotation
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
Ajouter un champ
|
|
|
|
</template>
|
|
|
|
</button>
|
|
|
|
|
2019-02-06 18:19:27 +01:00
|
|
|
<button class="button primary" @click.prevent="save">Enregistrer</button>
|
2018-11-14 16:26:00 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<Draggable :list="state.typesDeChamp" :options="{handle:'.handle'}">
|
|
|
|
<DraggableItem
|
|
|
|
v-for="(item, index) in state.typesDeChamp"
|
|
|
|
:state="state"
|
|
|
|
:index="index"
|
|
|
|
:item="item"
|
|
|
|
:key="item.id" />
|
|
|
|
</Draggable>
|
|
|
|
|
|
|
|
<div class="footer">
|
|
|
|
<button class="button" @click.prevent="addChamp">
|
|
|
|
<template v-if="state.isAnnotation">
|
|
|
|
Ajouter une annotation
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
Ajouter un champ
|
|
|
|
</template>
|
|
|
|
</button>
|
|
|
|
|
2019-02-06 18:19:27 +01:00
|
|
|
<button class="button primary" @click.prevent="save">Enregistrer</button>
|
2018-11-14 16:26:00 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./DraggableList.js"></script>
|