mirror of
https://github.com/luzhisheng/js_reverse.git
synced 2025-04-23 03:09:21 +08:00
10 lines
301 B
TypeScript
10 lines
301 B
TypeScript
import {defineStore} from 'pinia';
|
|
import {reactive} from 'vue'
|
|
|
|
// 组合式
|
|
export const useTalkStore = defineStore('talk', () => {
|
|
const storedTalkList = localStorage.getItem('talkList');
|
|
const talkList = reactive(storedTalkList ? JSON.parse(storedTalkList) : [])
|
|
return {talkList}
|
|
});
|