add initial project for frontend
Signed-off-by: Tobias Erbshäußer <tobias@tesoft.dev>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<template id="tesoft-button-template">
|
||||
<style>
|
||||
@import "src/styles/default.css";
|
||||
</style>
|
||||
|
||||
<button>
|
||||
<slot></slot>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script src="/src/components/button.ts" type="module"></script>
|
||||
@@ -0,0 +1,15 @@
|
||||
import {TesoftComponent} from "../scripts/main.ts";
|
||||
|
||||
export class TesoftButton extends TesoftComponent {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
const template = document.getElementById("tesoft-button-template") as HTMLTemplateElement;
|
||||
const templateContent = template.content;
|
||||
|
||||
const shadowRoot = this.attachShadow({mode: "open"});
|
||||
shadowRoot.appendChild(templateContent.cloneNode(true));
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("tesoft-button", TesoftButton);
|
||||
Reference in New Issue
Block a user