<template>
    <div>
        <!-- {{ userStore.name }} - {{ userStore.age }} - {{ userStore.sex }} -->
        <br />
        <button @click="updateUserName">修改值</button>
        <br />
        <button @click="updateOldUserName">修改回原值</button>
    </div>
</template>
<script setup>
import { useUserStore } from '~/store/user';

const userStore = useUserStore();
// 打印useUserStore里 state的信息

const updateUserName = () => {
    userStore.updateUserName('嗨！');
};

const updateOldUserName = () => {
    userStore.updateUserName('李四');
};
</script>
