refactor(site): use const instead of class prop;

This commit is contained in:
Ayo 2023-11-12 18:01:07 +01:00
parent 635337d973
commit 18263e1fee
2 changed files with 2 additions and 3 deletions

View file

@ -1,10 +1,10 @@
class CodeBlockComponent extends HTMLElement { class CodeBlockComponent extends HTMLElement {
connectedCallback() { connectedCallback() {
this.trimmed = this.innerHTML.trim(); const trimmed = this.innerHTML.trim();
const lang = this.getAttribute("language"); const lang = this.getAttribute("language");
this.innerHTML = ` this.innerHTML = `
<pre id="pre"><code id="code">${this.trimmed}</code></pre> <pre id="pre"><code id="code">${trimmed}</code></pre>
`; `;
/** /**

View file

@ -1,5 +1,4 @@
// @ts-check // @ts-check
/** /**
* Custom element using a minimal Web Component Base class * Custom element using a minimal Web Component Base class
* @see https://ayco.io/n/web-component-base * @see https://ayco.io/n/web-component-base