河畔的风

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

<script setup lang="ts">
  import { useStore } from '@/vuex';
  import {computed} from 'vue'
  const store = useStore()
  const onSubmit = () => {
    store.dispatch("incrementAction", 1);
  }
  let num = computed(() => store.state.count)
</script>

<template>
  <h1 @click="onSubmit">{{ count }}</h1>
  <h1>{{$store.state.count}}</h1>
</template>

 

posted on 2024-08-22 11:01  河畔的风  阅读(117)  评论(0编辑  收藏  举报