-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
116 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* This class does not work properly with Fresh at this point (June, 2024), | ||
* This code is here as a simple Lit decorator example to use once browsers | ||
* or Deno supports transpiling decorators to browser-compatible JavaScript. | ||
* | ||
* To use this on a Fresh page, make sure this file is exported in the main.ts | ||
* file and that it is referenced in the lit.tsx route file (uncomment | ||
* the commented code). | ||
*/ | ||
|
||
import { html, LitElement } from "npm:lit"; | ||
import { customElement, property } from "npm:lit/decorators.js"; | ||
|
||
@customElement("hello-world") | ||
export class HelloWorld extends LitElement { | ||
@property() | ||
name?: string = "world"; | ||
|
||
render() { | ||
return html`<p>Hello ${this.name}!</p>`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,17 @@ | |
"preview": "deno run -A main.ts", | ||
"update": "deno run -A -r https://fresh.deno.dev/update ." | ||
}, | ||
"lint": { "rules": { "tags": ["fresh", "recommended"] } }, | ||
"exclude": ["**/_fresh/*"], | ||
"lint": { | ||
"rules": { | ||
"tags": [ | ||
"fresh", | ||
"recommended" | ||
] | ||
} | ||
}, | ||
"exclude": [ | ||
"**/_fresh/*" | ||
], | ||
"nodeModulesDir": true, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
|
@@ -29,4 +38,4 @@ | |
"jsxImportSource": "preact", | ||
"experimentalDecorators": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
export default function LitPage() { | ||
return ( | ||
<div class="px-4 py-8 mx-auto bg-[#86efac]"> | ||
<div class="text-4xl font-bold">Lit Web Components</div> | ||
<hr /> | ||
<div> | ||
<div class="text-4xl font-bold">Lit Web Components</div> | ||
<hr /> | ||
<div> | ||
<h2>Greeting Component</h2> | ||
<my-lit-message message="Greetings from a custom element!"> | ||
</my-lit-message> | ||
</div> | ||
<h2>Greeting Component</h2> | ||
<my-lit-message message="Greetings from a custom element!"> | ||
</my-lit-message> | ||
</div> | ||
<div> | ||
<h2>Custom Alert Web Component</h2> | ||
<custom-alert>This is a dismissible message</custom-alert> | ||
</div> | ||
{ | ||
/* <div> | ||
<h2>Lit Hello World Using Decorators</h2> | ||
<hello-world></hello-world> | ||
</div> */ | ||
} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.