mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 19:50:15 +08:00
examples/customlayout: feature: add event listener for enter key (#2176)
This commit is contained in:
parent
dc209d1462
commit
53f63f71a0
@ -2,7 +2,7 @@ import './style.css';
|
||||
import './app.css';
|
||||
|
||||
import logo from './assets/images/logo-universal.png';
|
||||
import {Greet} from '../wailsjs/go/main/App';
|
||||
import { Greet } from '../wailsjs/go/main/App';
|
||||
|
||||
document.querySelector('#app').innerHTML = `
|
||||
<img id="logo" class="logo">
|
||||
@ -14,6 +14,11 @@ document.querySelector('#app').innerHTML = `
|
||||
</div>
|
||||
`;
|
||||
document.getElementById('logo').src = logo;
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.code === "Enter") {
|
||||
window.greet();
|
||||
}
|
||||
});
|
||||
|
||||
let nameElement = document.getElementById("name");
|
||||
nameElement.focus();
|
||||
|
Loading…
Reference in New Issue
Block a user