-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.vue
84 lines (64 loc) · 1.4 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<div>
<h2 class="text-center">
Welcome to your
<a href="https://www.plasmo.com" target="_blank">Plasmo</a> Extension!
</h2>
<div class="container">
<QBtn @click="decrement">-</QBtn>
<p>
<b>{{ state.count }}</b>
</p>
<QBtn @click="increment">+</QBtn>
</div>
</div>
<p v-if="state.action" class="action text-center">
{{ state.action }}
</p>
<a href="https://docs.plasmo.com" target="_blank">
<QChip>View Docs</QChip>
</a>
</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 lang="ts" setup>
import type {PlasmoGetStyle} from "plasmo";
import {QBtn, QChip, Quasar} from "quasar";
import cssText from "quasar/src/css/index.sass";
import type {App} from "vue"
import {reactive} from "vue";
const state = reactive({count: 0, action: null})
const getStyle: PlasmoGetStyle = () => {
const style = document.createElement("style");
// Append your existing CSS text
style.textContent = cssText;
return style;
};
function increment() {
state.count++
state.action = "increment"
}
function decrement() {
state.count--
state.action = "decrement"
}
defineOptions({
prepare(app: App) {
app.use(Quasar, {});
},
});
</script>