-
Notifications
You must be signed in to change notification settings - Fork 2
/
popup.svelte
41 lines (39 loc) · 934 Bytes
/
popup.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script lang="ts">
export let count = 0;
let action: string = null;
function increment() {
count += 1;
action = "increment";
}
function decrement() {
count -= 1;
action = "decrement";
}
</script>
<style>
.container {
min-width: 470px;
display: flex;
align-items: center;
justify-content: center;
gap: 47px;
}
.action {
color: #470;
font-weight: bold;
}
.text-center {
text-align: center;
}
</style>
<div>
<h2 class="text-center">
Welcome to your <a href="https://www.plasmo.com" target="_blank">Plasmo</a> Extension!
</h2>
<div class="container">
<button on:click={decrement}>-</button>
<p>Current count: <b>{count}</b></p>
<button on:click={increment}>+</button>
</div>
{#if action}<p class="action text-center">{action}</p>{/if}
</div>