ajouter formulaire ajout dans liste.Vue

front
Gwenael PLANCHON 1 year ago
parent 0de04c58b1
commit c5adef968b

@ -2,6 +2,7 @@
import { REST_API } from '@/assets/const'; import { REST_API } from '@/assets/const';
import LigneDonnee from './ListeLigne.vue'; import LigneDonnee from './ListeLigne.vue';
import Ajout from './Ajout.vue';
export default{ export default{
data() { data() {
@ -51,15 +52,15 @@ export default{
}) })
} }
}, },
components: { LigneDonnee } components: { LigneDonnee, Ajout }
} }
</script> </script>
<template> <template>
<!-- TODO : remplacer input par select ?--> <!-- TODO : remplacer input par select ?-->
<label for="endpoint">Endpoint API (REST) {{ REST_API }}/</label> <label for="endpointInput">Endpoint API (REST) {{ REST_API }}/</label>
<input v-model="endpoint" id="endpoint"> <input v-model="endpoint" id="endpointInput">
<button @click="rafraichirEndpoint()">Rafraichir</button> <button @click="rafraichirEndpoint()">Rafraichir</button>
<!-- TODO : popup qui affiche Ajout.vue pour ajouter une nouvelle ligne--> <!-- TODO : popup qui affiche Ajout.vue pour ajouter une nouvelle ligne-->
<table class="table"> <table class="table">
@ -79,4 +80,7 @@ export default{
<button :class="{ invisible: !prev }" class="btn btn-secondary" @click="this.getdonnees(this.prev)">Prev</button> <button :class="{ invisible: !prev }" class="btn btn-secondary" @click="this.getdonnees(this.prev)">Prev</button>
<button :class="{ invisible: !next }" class="btn btn-secondary" @click="this.getdonnees(this.next)">Next</button> <button :class="{ invisible: !next }" class="btn btn-secondary" @click="this.getdonnees(this.next)">Next</button>
<button :class="{ invisible: !last }" class="btn btn-secondary" @click="this.getdonnees(this.last)">Last</button> <button :class="{ invisible: !last }" class="btn btn-secondary" @click="this.getdonnees(this.last)">Last</button>
<Ajout :endpoint="endpoint" :donnee="donnees[0]??{}"/>
</template> </template>
Loading…
Cancel
Save