<!--
 * @FileDescription: Pinia example
 * @Date: 2023-10-08
 * @LastEditTime: 2023-10-08
-->
<script setup lang="ts">
import { useCounterStore } from './stores/counter';

const counter = useCounterStore();
counter.count++;
counter.$patch({
  count: counter.count + 1,
})

// // 或使用 action 代替
// counter.increment();
</script>
<template>
  <div>
    <div class="q-pa-md">
      <a href="https://pinia.vuejs.org/zh/introduction.html" target="_blank">Pinia文档</a>
    </div>
    <div class="q-pa-md">
      <button>使用</button>
      <button>{{ counter.count }}</button>
      <button>{{ counter.doubleCount }}</button>
      <button>{{ counter.doublePlusOne }}</button>
    </div>
  </div>
</template>

<style lang="scss" scoped></style>
