mirror of https://github.com/sveltejs/svelte
Examples (#48)
* docs: add examples 00 to 04 * add examples 05 * add examples 06 * add examples 07 * add examples 08 * add examples 09 * add examples 10 * add examples 11 * add examples 12 * add examples 13 * add examples 14 * add examples 15 * add examples 16 * add examples 17 * add examples 18 * add examples 19-20 * add examples 21 * forgot flight booker --------- Co-authored-by: Romain Crestey <romain.crestey@radiofrance.com>pull/9156/head
parent
c429f91681
commit
95cda04fac
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Text inputs"
|
||||
"title": "Inputs texte"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Numeric inputs"
|
||||
"title": "Inputs numériques"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Checkbox inputs"
|
||||
"title": "Inputs checkbox"
|
||||
}
|
||||
|
||||
@ -1,49 +1,49 @@
|
||||
<script>
|
||||
let scoops = 1;
|
||||
let flavours = ['Mint choc chip'];
|
||||
let flavours = ['Éclats de menthe'];
|
||||
|
||||
let menu = ['Cookies and cream', 'Mint choc chip', 'Raspberry ripple'];
|
||||
let menu = ['Cookie crémeux', 'Éclats de menthe', 'Vague à la fraise'];
|
||||
|
||||
function join(flavours) {
|
||||
if (flavours.length === 1) return flavours[0];
|
||||
return `${flavours.slice(0, -1).join(', ')} and ${flavours[flavours.length - 1]}`;
|
||||
return `${flavours.slice(0, -1).join(', ')} et ${flavours[flavours.length - 1]}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<h2>Size</h2>
|
||||
<h2>Nombre de boules</h2>
|
||||
|
||||
<label>
|
||||
<input type="radio" bind:group={scoops} value={1} />
|
||||
One scoop
|
||||
<input type="radio" bind:group={scoops} name="scoops" value={1} />
|
||||
Une boule
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" bind:group={scoops} value={2} />
|
||||
Two scoops
|
||||
<input type="radio" bind:group={scoops} name="scoops" value={2} />
|
||||
Deux boules
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="radio" bind:group={scoops} value={3} />
|
||||
Three scoops
|
||||
<input type="radio" bind:group={scoops} name="scoops" value={3} />
|
||||
Trois boules
|
||||
</label>
|
||||
|
||||
<h2>Flavours</h2>
|
||||
<h2>Parfums</h2>
|
||||
|
||||
{#each menu as flavour}
|
||||
<label>
|
||||
<input type="checkbox" bind:group={flavours} value={flavour} />
|
||||
<input type="checkbox" bind:group={flavours} name="flavours" value={flavour} />
|
||||
{flavour}
|
||||
</label>
|
||||
{/each}
|
||||
|
||||
{#if flavours.length === 0}
|
||||
<p>Please select at least one flavour</p>
|
||||
<p>Veuillez choisir au moins un parfum</p>
|
||||
{:else if flavours.length > scoops}
|
||||
<p>Can't order more flavours than scoops!</p>
|
||||
<p>Vous ne pouvez pas choisir plus de parfums que de boules !</p>
|
||||
{:else}
|
||||
<p>
|
||||
You ordered {scoops}
|
||||
{scoops === 1 ? 'scoop' : 'scoops'}
|
||||
of {join(flavours)}
|
||||
Vous avez commandé {scoops}
|
||||
{scoops === 1 ? 'boule' : 'boules'}
|
||||
de {join(flavours)}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Group inputs"
|
||||
"title": "Inputs groupés"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Textarea inputs"
|
||||
"title": "Inputs de zone de texte"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "File inputs"
|
||||
"title": "Inputs de fichiers"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Select bindings"
|
||||
"title": "Liaisons de sélection"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Select multiple"
|
||||
"title": "Sélection multiple"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Each block bindings"
|
||||
"title": "Liaisons de bloc each"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Media elements"
|
||||
"title": "Éléments media"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Component bindings"
|
||||
"title": "Liaisons de composant"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Bindings"
|
||||
"title": "Liaisons"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "beforeUpdate and afterUpdate"
|
||||
"title": "beforeUpdate et afterUpdate"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Lifecycle"
|
||||
"title": "Cycle de vie"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Writable stores"
|
||||
"title": "Stores d'écriture"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Auto-subscriptions"
|
||||
"title": "Abonnements automatiques"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Readable stores"
|
||||
"title": "Stores de lecture"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Derived stores"
|
||||
"title": "Stores dérivés"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Custom stores"
|
||||
"title": "Stores personnalisés"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Tweened"
|
||||
"title": "Interpolation"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Spring"
|
||||
"title": "Ressorts"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Motion"
|
||||
"title": "Mouvement"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "The transition directive"
|
||||
"title": "La directive de transition"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Adding parameters"
|
||||
"title": "Ajout de paramètres"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "In and out"
|
||||
"title": "In et out"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Custom CSS transitions"
|
||||
"title": "Transitions CSS personnalisées"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Custom JS transitions"
|
||||
"title": "Transitions JS personnalisées"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Transition events"
|
||||
"title": "Évènements de transition"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Deferred transitions"
|
||||
"title": "Transitions retardées"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "The animate directive"
|
||||
"title": "La directive animate"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Ease Visualiser"
|
||||
"title": "Visualisateur de lissage"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Easing"
|
||||
"title": "Lissage"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Clock"
|
||||
"title": "Horloge"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Bar chart"
|
||||
"title": "Graphique en barres"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Area chart"
|
||||
"title": "Graphique d'aire"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Scatterplot"
|
||||
"title": "Nuages de points"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "SVG transitions"
|
||||
"title": "Transitions SVG"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "The use directive"
|
||||
"title": "La directive use"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Adding parameters"
|
||||
"title": "Ajout de paramètres"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "A more complex action"
|
||||
"title": "Une action plus complexe"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "The class directive"
|
||||
"title": "La directive de classe"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Shorthand class directive"
|
||||
"title": "Directive de classe raccourcie"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Slot fallbacks"
|
||||
"title": "Slots par défaut"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Named slots"
|
||||
"title": "Slots nommés"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Slot props"
|
||||
"title": "Propriétés de slot"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Conditional Slots"
|
||||
"title": "Slots conditionnels"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Modal"
|
||||
"title": "Modale"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Component composition"
|
||||
"title": "Composition de composants"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "setContext and getContext"
|
||||
"title": "setContext et getContext"
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"title": "Context API"
|
||||
"title": "API de contexte"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue