18 lines
374 B
JavaScript
18 lines
374 B
JavaScript
import { defineStore } from "pinia";
|
|
// import * as shopApi from "@/http/api/shop.js";
|
|
|
|
// 聊天
|
|
export const useChatStore = defineStore("chat", {
|
|
state: () => {
|
|
return {
|
|
chatList: [],
|
|
};
|
|
},
|
|
actions: {
|
|
sendMessage(message) {
|
|
this.chatList.push(message);
|
|
},
|
|
},
|
|
unistorage: true, // 开启后对 state 的数据读写都将持久化
|
|
});
|