theme | transition | title | enableMenu | enableSearch | enableChalkboard | slideNumber |
---|---|---|---|---|---|---|
black |
slide |
Componentes Agnósticos |
true |
false |
true |
true |
Luís Antônio
"Que é adepto ou se pode referir ao agnosticismo." Dicio
Não depende de nenhuma estrutura.
JavaScript, Java, C#, Python e etc.
Web Components is a suite of different technologies allowing you to create reusable custom elements
- Custom elements
- Shadow DOM
- HTML templates
<ds-button variant="primary">Login</ds-button>
<my-element>
<open-234>
<html5-🤟>
<input-🥞></input-🥞>
<button onclick="showContent()">Show hidden content</button>
<template>
<h2>Flower</h2>
<img src="img_white_flower.jpg" width="214" height="204">
</template>
<script>
function showContent() {
var temp = document.getElementsByTagName("template")[0];
var clon = temp.content.cloneNode(true);
document.body.appendChild(clon);
}
</script>
export class Button extends HTMLElement {
constructor() {
super();
}
}
customElements.define("ds-button", Button);
export class Button extends HTMLElement {
constructor() {
super();
this.innerHTML = `<h3>${this.innerText}</h3>`
}
}
<ds-button>Tonhão</ds-button>
h3 {
color: red;
background-color: blue;
}
Preferences > Elements > Show user agent shadow
const template = document.createElement("template");
template.innerHTML = `<h3><slot></slot></h3>`
export class Button extends HTMLElement {
constructor() {
super();
const shadow = this.attachShadow({ mode: "open" });
shadow.append(template.content.cloneNode(true));
}
}