✨ 完成大作业部分及其打磨
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user