完成大作业部分及其打磨

This commit is contained in:
li-chx
2025-05-11 17:22:21 +08:00
parent 3ab2c26776
commit 0622b15509
23 changed files with 651 additions and 160 deletions
@@ -0,0 +1,23 @@
<script setup lang="ts">
const store = useArticleStore();
const content = ref(store.currentArticle.content);
const title = ref(store.currentArticle.title);
async function saveArticle(data: { title: string; content: string }) {
store.currentArticle.title = data.title;
store.currentArticle.content = data.content;
await store.modifyArticle();
useRouter().back();
}
</script>
<template>
<ArticleEditor
:base-content="content"
:base-title="title"
:save-button="'更改文章'"
@article-edit-finish="saveArticle"
/>
</template>
<style scoped lang="less"></style>