mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01: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:
parent
66f79c2e51
commit
b2cec41fbf
2 changed files with 44 additions and 46 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue