vue3部分组件通信方式

24 lines
560 B

5 months ago
<template>
<div class="box2">
<h1>{{useInfo.count}}+++++++{{useInfo.total}}</h1>
5 months ago
<hr>
<p @click="updateTodo">{{todoStore.todos}}--{{todoStore.arr}}====={{todoStore.total}}</p>
5 months ago
</div>
</template>
<script setup lang="ts">
import useInfoStore from "@/store/modules/info";
let useInfo = useInfoStore();
5 months ago
import useTodoStore from "@/store/modules/todo";
let todoStore = useTodoStore();
const updateTodo =()=>{
todoStore.updateTodo();
}
5 months ago
</script>
<style scoped>
.box2{
width: 300px;
height: 200px;
background: lightgoldenrodyellow;
}
</style>