update
This commit is contained in:
@@ -9,17 +9,20 @@ import {
|
||||
Toast,
|
||||
} from '@douyinfe/semi-ui';
|
||||
import { useNoteStore } from '../../stores/useNoteStore';
|
||||
import { useUIStore } from '../../stores/useUIStore';
|
||||
import noteService from '../../services/note.service';
|
||||
import type { INote } from '../../types';
|
||||
|
||||
export default function HomePage() {
|
||||
const { homeData, setHomeData, setCurrentNote } = useNoteStore();
|
||||
const setActiveView = useUIStore((s) => s.setActiveView);
|
||||
|
||||
const loadNote = (id: number) => {
|
||||
noteService.get(id).then(
|
||||
(res) => {
|
||||
const note = res.data;
|
||||
setCurrentNote(note.id, note.title, note.context);
|
||||
setActiveView('note');
|
||||
},
|
||||
() => Toast.error('加载笔记失败'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user