-
Notifications
You must be signed in to change notification settings - Fork 103
Traduction de components-props.md
#155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Haeresis <[email protected]>
Signed-off-by: Haeresis <[email protected]>
src/v2/guide/components-props.md
Outdated
type: guide | ||
order: 102 | ||
--- | ||
|
||
> This page assumes you've already read the [Components Basics](components.html). Read that first if you are new to components. | ||
> Cette page suppose que vous avez déjà lu les principes de base des [composants](components.html). Lisez [cette partie](components.html) en premier si les composants sont quelque chose de nouveau pour vous. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lisez-les en premier ...
Non ?
src/v2/guide/components-props.md
Outdated
|
||
<p>Cette page est en cours de traduction. Pour nous aider, vous pouvez participer sur <a href="https://github.com/vuejs-fr/vuejs.org" target="_blank">le dépôt GitHub dédié de Vuejs-FR</a>.</p><p>HTML attribute names are case-insensitive, so browsers will interpret any uppercase characters as lowercase. That means when you're using in-DOM templates, camelCased prop names need to use their kebab-cased (hyphen-delimited) equivalents:</p> | ||
Les noms d'attributs HTML sont insensibles à la casse, aussi les navigateurs interpréteront de la même manière les majuscules et les minuscules. Cela signifie que pour l'utilisation des templates directement dans le DOM les props en camelCase doivent utiliser leur équivalent kebab-case (délimités par des tirets) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Peut-être une virgule entre le DOM
et les props
?
Pour laisser souffler le lecteur 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bon taf, quelques petites remarques pour ma part ^^
Sinon pas mal le inheritAttrs
, je connaissais pas
src/v2/guide/components-props.md
Outdated
``` | ||
|
||
You've also seen props assigned dynamically with `v-bind`, such as in: | ||
vous avez également vu qu'il était possible d'affecter des props dynamiquement avec `v-bind` comme ceci : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vous avez également
src/v2/guide/components-props.md
Outdated
@@ -232,7 +232,7 @@ The `type` can be one of the following native constructors: | |||
- Function | |||
- Symbol | |||
|
|||
In addition, `type` can also be a custom constructor function and the assertion will be made with an `instanceof` check. For example, given the following constructor function exists: | |||
En plus, `type` peut aussi être une fonction constructeur personnalisée et l'assertion pourra être testée avec `instanceof`. Par exemple, avec la fonction constructeur existante suivante : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De plus
src/v2/guide/components-props.md
Outdated
|
||
For example, imagine we're using a 3rd-party `bootstrap-date-input` component with a Bootstrap plugin that requires a `data-date-picker` attribute on the `input`. We can add this attribute to our component instance: | ||
Par exemple, imaginez que vous utilisiez un composant tiers `bootstrap-date-input` avec un plugin Bootstrap qui nécessite un `data-date-picker` attribut sul l'`input`. Nous pouvons ajouter cet attribut à notre instance de composant : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attribut sur l'
input
src/v2/guide/components-props.md
Outdated
|
||
<p>Cette page est en cours de traduction. Pour nous aider, vous pouvez participer sur <a href="https://github.com/vuejs-fr/vuejs.org" target="_blank">le dépôt GitHub dédié de Vuejs-FR</a>.</p><p>HTML attribute names are case-insensitive, so browsers will interpret any uppercase characters as lowercase. That means when you're using in-DOM templates, camelCased prop names need to use their kebab-cased (hyphen-delimited) equivalents:</p> | ||
Les noms d'attributs HTML sont insensibles à la casse, aussi les navigateurs interpréteront de la même manière les majuscules et les minuscules. Cela signifie que pour l'utilisation des templates directement dans le DOM les props en camelCase doivent utiliser leur équivalent kebab-case (délimités par des tirets) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "interprèteront" en graphie rectifiée
src/v2/guide/components-props.md
Outdated
|
||
In addition, every time the parent component is updated, all props in the child component will be refreshed with the latest value. This means you should **not** attempt to mutate a prop inside a child component. If you do, Vue will warn you in the console. | ||
De plus, chaque fois que le composant parent est mis à jour, toutes les props du composant enfant vont être mises à jour avec les dernières valeurs. Cela signifie que vous ne devriez **pas** essayer du muter une prop depuis l'intérieur d'un composant. Si vous le faite, Vue lancera un avertissement dans la console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "Si vous le faites,"
src/v2/guide/components-props.md
Outdated
|
||
There are usually two cases where it's tempting to mutate a prop: | ||
Il y a couramment deux cas où vous seriez tenter de muter une prop : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "tenté"
src/v2/guide/components-props.md
Outdated
@@ -170,58 +170,58 @@ There are usually two cases where it's tempting to mutate a prop: | |||
} | |||
``` | |||
|
|||
<p class="tip">Note that objects and arrays in JavaScript are passed by reference, so if the prop is an array or object, mutating the object or array itself inside the child component **will** affect parent state.</p> | |||
<p class="tip">Notez que les objets et les tableaux en JavaScript sont passés par référence, ce qui signifie que si la prop est un objet ou un tableau, muter l'objet ou le tableu lui-même dans l'enfant **va** affecter l'état du parent.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "ou le tableau"
src/v2/guide/components-props.md
Outdated
|
||
Components can specify requirements for its props, such as the types you've already seen. If a requirement isn't met, Vue will warn you in the browser's JavaScript console. This is especially useful when developing a component that's intended to be used by others. | ||
Les composants peuvent spécifier des conditions requises pour leurs props, comme les types que nous avons déjà vu. Si les conditions requises ne sont pas validées, Vue va vous en avertir dans la console JavaScript du navigateur. Cela est particulièrement utile quand on développe un composant destiné à être utilisé par les autres. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "déjà vus."
src/v2/guide/components-props.md
Outdated
|
||
For most attributes, the value provided to the component will replace the value set by the component. So for example, passing `type="text"` will replace `type="date"` and probably break it! Fortunately, the `class` and `style` attributes are a little smarter, so both values are merged, making the final value: `form-control date-picker-theme-dark`. | ||
Pour la plupard des attributs, la valeur fournie par le composant va remplacé la valeur définie par le composant. Aussi par exemple, passer `type="text"` va remplacer `type="date"` et probablement tout casser ! Heureusement, les attributs `class` et `style` sont plus malins. Ces deux valeurs sont fusionnées, fournissant la valeur finale `form-control date-picker-theme-dark`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "Pour la plupart des attributs, la valeur fournie par le composant va remplacer la valeur définie par le composant."
src/v2/guide/components-props.md
Outdated
@@ -302,7 +302,7 @@ Vue.component('my-component', { | |||
}) | |||
``` | |||
|
|||
This can be especially useful in combination with the `$attrs` instance property, which contains the attribute names and values passed to a component, such as: | |||
Cela est particulièrement utile avec l'utilisation combinée de la propriété d'instance `$attrs` qui contient les noms et valeurs passées à un composant comme ceci : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- "passés"
Seems nice to me 🎉 |
On s'attaque aux props parce qu'on à un peu de temps ! Vos corrections orthographique sons les bienvenues comme toujours !