mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Fix lit-ts template (#1494)
* Fix lit-ts template * Fixing generate Template * Remove bad null check Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
co-authored by
Lea Anthony
parent
66f79c2e51
commit
b2cec41fbf
+22
-23
@@ -68,32 +68,31 @@ export class MyElement extends LitElement {
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
@property()
|
||||
resultText = "Please enter your name below 👇"
|
||||
@property()
|
||||
resultText = "Please enter your name below 👇"
|
||||
|
||||
greet()
|
||||
{
|
||||
let thisName = this.shadowRoot.getElementById('name').value
|
||||
Greet(thisName).then(result => {
|
||||
this.resultText = result
|
||||
});
|
||||
}
|
||||
greet() {
|
||||
let thisName = (this.shadowRoot.getElementById('name') as HTMLInputElement)?.value;
|
||||
if (thisName) {
|
||||
Greet(thisName).then(result => {
|
||||
this.resultText = result
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
return html`
|
||||
<main>
|
||||
<img id="logo" src=${logo} alt="Wails logo">
|
||||
<div class="result" id="result">${this.resultText}</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||
<button @click=${this.greet} class="btn">Greet</button>
|
||||
</div>
|
||||
</main>
|
||||
`
|
||||
}
|
||||
render() {
|
||||
return html`
|
||||
<main>
|
||||
<img id="logo" src=${logo} alt="Wails logo">
|
||||
<div class="result" id="result">${this.resultText}</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||
<button @click=${this.greet} class="btn">Greet</button>
|
||||
</div>
|
||||
</main>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
+22
-23
@@ -68,32 +68,31 @@ export class MyElement extends LitElement {
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
|
||||
@property()
|
||||
resultText = "Please enter your name below 👇"
|
||||
@property()
|
||||
resultText = "Please enter your name below 👇"
|
||||
|
||||
greet()
|
||||
{
|
||||
let thisName = this.shadowRoot.getElementById('name').value
|
||||
Greet(thisName).then(result => {
|
||||
this.resultText = result
|
||||
});
|
||||
}
|
||||
greet() {
|
||||
let thisName = (this.shadowRoot.getElementById('name') as HTMLInputElement)?.value;
|
||||
if (thisName) {
|
||||
Greet(thisName).then(result => {
|
||||
this.resultText = result
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
return html`
|
||||
<main>
|
||||
<img id="logo" src=${logo} alt="Wails logo">
|
||||
<div class="result" id="result">${this.resultText}</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||
<button @click=${this.greet} class="btn">Greet</button>
|
||||
</div>
|
||||
</main>
|
||||
`
|
||||
}
|
||||
render() {
|
||||
return html`
|
||||
<main>
|
||||
<img id="logo" src=${logo} alt="Wails logo">
|
||||
<div class="result" id="result">${this.resultText}</div>
|
||||
<div class="input-box" id="input">
|
||||
<input class="input" id="name" type="text" autocomplete="off"/>
|
||||
<button @click=${this.greet} class="btn">Greet</button>
|
||||
</div>
|
||||
</main>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
Reference in New Issue
Block a user