demarches-normaliennes/app/javascript/new_design/administrateur/DraggableList.vue

41 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-14 16:26:00 +01:00
<template>
<div class="champs-editor">
<div v-if="state.typesDeChamp.length > 3" class="header">
2019-02-08 17:40:59 +01:00
<button class="button" v-scroll-to="'.footer'" @click.prevent="addChamp">
2018-11-14 16:26:00 +01:00
<template v-if="state.isAnnotation">
Ajouter une annotation
</template>
<template v-else>
Ajouter un champ
</template>
</button>
<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">
2019-02-08 17:40:59 +01:00
<button class="button" v-scroll-to="'.footer'" @click.prevent="addChamp">
2018-11-14 16:26:00 +01:00
<template v-if="state.isAnnotation">
Ajouter une annotation
</template>
<template v-else>
Ajouter un champ
</template>
</button>
<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>