-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.vue
52 lines (46 loc) · 914 Bytes
/
popup.vue
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
42
43
44
45
46
47
48
49
50
51
52
<template>
<div>
<h2 class="text-center">
Welcome to your
<a href="https://www.plasmo.com" target="_blank">Plasmo</a> Extension!
</h2>
<div class="container">
<button @click="decrement">-</button>
<p>
<b>{{ state.count }}</b>
</p>
<button @click="increment">+</button>
</div>
</div>
<p v-if="state.action" class="action text-center">
{{ state.action }}
</p>
</template>
<style>
.container {
min-width: 470px;
display: flex;
align-items: center;
justify-content: center;
gap: 47px;
}
.text-center {
text-align: center;
}
.action {
color: #470;
font-weight: bold;
}
</style>
<script setup>
import { reactive } from "vue"
const state = reactive({ count: 0, action: null })
function increment() {
state.count++
state.action = "increment"
}
function decrement() {
state.count--
state.action = "decrement"
}
</script>