From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- files/fr/web/api/window/customelements/index.html | 68 ----------------------- files/fr/web/api/window/customelements/index.md | 68 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 files/fr/web/api/window/customelements/index.html create mode 100644 files/fr/web/api/window/customelements/index.md (limited to 'files/fr/web/api/window/customelements') diff --git a/files/fr/web/api/window/customelements/index.html b/files/fr/web/api/window/customelements/index.html deleted file mode 100644 index 7d7d57c203..0000000000 --- a/files/fr/web/api/window/customelements/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: Window.customElements -slug: Web/API/Window/customElements -tags: - - API - - CustomElementRegistry - - Property - - Reference - - Web Components - - Window - - custom elements -translation_of: Web/API/Window/customElements ---- -
{{APIRef}}
- -

La propriété en lecture seule customElements de l'interface {{domxref("Window")}} renvoie une référence à l'objet {{domxref("CustomElementRegistry")}}, qui peut être utilisée pour enregistrer de nouveaux éléments personnalisés et obtenir des informations sur des éléments personnalisés enregistrés.

- -

Syntaxe

- -
let registreElementsPersonnalises = window.customElements;
- -

Valeur retournée

- -

Une instance d'objet {{domxref("CustomElementRegistry")}} représentant le registre des éléments personnalisés pour la fenêtre en cours.

- -

Exemples

- -

L'exemple le plus courant d'utilisation de cette propriété que vous verrez sera d'obtenir l'accès à la méthode {{domxref ("CustomElementRegistry.define()")}} pour définir et enregistrer un nouvel élément personnalisé, par exemple :

- -
let registreElementsPersonnalises = window.customElements;
-registreElementsPersonnalises.define('mon-element-personnalise', MonElementPersonnalise);
- -

Cependant, il est généralement raccourci en quelque chose comme :

- -
customElements.define('details-element',
-  class extends HTMLElement {
-    constructor() {
-      super();
-      const modele = document
-        .getElementById('modele-details-element')
-        .content;
-      const racineOmbre = this.attachShadow({mode: 'open'})
-        .appendChild(template.cloneNode(true));
-  }
-});
- -

Voir notre repo web-components-examples pour davantage d'exemples d'utilisation.

- -

Spécification

- - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName("HTML WHATWG", "custom-elements.html#dom-window-customelements", "window.customElements")}}{{Spec2("HTML WHATWG")}}Définition initiale.
- -

Compatibilité des navigateurs

- -

{{Compat("api.Window.customElements")}}

diff --git a/files/fr/web/api/window/customelements/index.md b/files/fr/web/api/window/customelements/index.md new file mode 100644 index 0000000000..7d7d57c203 --- /dev/null +++ b/files/fr/web/api/window/customelements/index.md @@ -0,0 +1,68 @@ +--- +title: Window.customElements +slug: Web/API/Window/customElements +tags: + - API + - CustomElementRegistry + - Property + - Reference + - Web Components + - Window + - custom elements +translation_of: Web/API/Window/customElements +--- +
{{APIRef}}
+ +

La propriété en lecture seule customElements de l'interface {{domxref("Window")}} renvoie une référence à l'objet {{domxref("CustomElementRegistry")}}, qui peut être utilisée pour enregistrer de nouveaux éléments personnalisés et obtenir des informations sur des éléments personnalisés enregistrés.

+ +

Syntaxe

+ +
let registreElementsPersonnalises = window.customElements;
+ +

Valeur retournée

+ +

Une instance d'objet {{domxref("CustomElementRegistry")}} représentant le registre des éléments personnalisés pour la fenêtre en cours.

+ +

Exemples

+ +

L'exemple le plus courant d'utilisation de cette propriété que vous verrez sera d'obtenir l'accès à la méthode {{domxref ("CustomElementRegistry.define()")}} pour définir et enregistrer un nouvel élément personnalisé, par exemple :

+ +
let registreElementsPersonnalises = window.customElements;
+registreElementsPersonnalises.define('mon-element-personnalise', MonElementPersonnalise);
+ +

Cependant, il est généralement raccourci en quelque chose comme :

+ +
customElements.define('details-element',
+  class extends HTMLElement {
+    constructor() {
+      super();
+      const modele = document
+        .getElementById('modele-details-element')
+        .content;
+      const racineOmbre = this.attachShadow({mode: 'open'})
+        .appendChild(template.cloneNode(true));
+  }
+});
+ +

Voir notre repo web-components-examples pour davantage d'exemples d'utilisation.

+ +

Spécification

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName("HTML WHATWG", "custom-elements.html#dom-window-customelements", "window.customElements")}}{{Spec2("HTML WHATWG")}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.Window.customElements")}}

-- cgit v1.2.3-54-g00ecf