mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-17 09:29:30 +08:00
Start Events. List styling moved to global scope.
This commit is contained in:
parent
256e84c4d4
commit
8a2acacc37
@ -173,4 +173,14 @@
|
|||||||
user-select: initial; /* Non-prefixed version, currently
|
user-select: initial; /* Non-prefixed version, currently
|
||||||
supported by Chrome, Edge, Opera and Firefox */
|
supported by Chrome, Edge, Opera and Firefox */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
margin-top: 2rem;
|
||||||
|
margin-left: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list li {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import {selectedPage} from './Store';
|
import {selectedPage} from './Store';
|
||||||
import TitlePage from './pages/TitlePage.svelte';
|
import TitlePage from './pages/TitlePage.svelte';
|
||||||
import Logging from './pages/logging/Logging.svelte';
|
import Logging from './pages/logging/Logging.svelte';
|
||||||
import Events from './pages/Events.svelte';
|
import Events from './pages/events/Events.svelte';
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
border-top: 1px solid #5555;
|
border-top: 1px solid #5555;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
/* margin-bottom: 15px; */
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -1,26 +0,0 @@
|
|||||||
<script>
|
|
||||||
|
|
||||||
import CodeBlock from '../components/CodeBlock.svelte';
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h4>Events</h4>
|
|
||||||
|
|
||||||
Wails includes a unified events system which allows you to do the following in either Go or Javascript:
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>On</li>
|
|
||||||
<li>Once</li>
|
|
||||||
<li>OnMultiple</li>
|
|
||||||
<li>Emit</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<CodeBlock title="Events.On(eventName, callback)" description="etc etc etc "></CodeBlock>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
h5 {
|
|
||||||
margin-top: 3rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
27
v2/test/kitchensink/frontend/src/pages/events/Events.svelte
Normal file
27
v2/test/kitchensink/frontend/src/pages/events/Events.svelte
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<script>
|
||||||
|
|
||||||
|
import CodeBlock from '../../components/CodeBlock.svelte';
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4>Events</h4>
|
||||||
|
|
||||||
|
Wails includes a unified events system which allows you to send events in either Go or Javascript and receive them in either Go or Javascript. The events methods may be accessed through the <code>runtime.Events</code> object. Available methods are:
|
||||||
|
|
||||||
|
<ul class="list">
|
||||||
|
<li>On</li>
|
||||||
|
<li>Once</li>
|
||||||
|
<li>OnMultiple</li>
|
||||||
|
<li>Emit</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Events are intraoperable and data sent in events is translated between Go and Javascript automatically.
|
||||||
|
|
||||||
|
<div style="padding: 15px"></div>
|
||||||
|
|
||||||
|
<CodeBlock title="Events.On(eventName, callback)" description="etc etc etc "></CodeBlock>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
@ -67,16 +67,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</CodeBlock>
|
</CodeBlock>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
.list {
|
|
||||||
margin-top: 2rem;
|
|
||||||
margin-left: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list li {
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue
Block a user