代码拉取完成,页面将自动刷新
<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>
<a href="https://docs.plasmo.com" target="_blank"> View Docs </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 setup lang="ts">
import { reactive } from "vue"
import type { App } from "vue"
const state = reactive({ count: 0, action: null })
function increment() {
state.count++
state.action = "increment"
}
function decrement() {
state.count--
state.action = "decrement"
}
defineOptions({
prepare(app: App) {
// Use any plugins here:
// app.use
}
})
</script>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。