like 与 admin name

This commit is contained in:
2022-02-08 03:37:22 +08:00
parent e8bcfe147e
commit 7db27799c0
9 changed files with 80 additions and 14 deletions

View File

@@ -68,7 +68,10 @@ export default {
createpost() {
console.log(this.post);
this.$axios.post("/api/post", this.post).then((res) => {
console.log(res.data);
if (res.status === 200) {
this.postlist.push(res.data);
this.post.data = "";
}
});
},
},

View File

@@ -9,12 +9,10 @@
.tags
span.tag test
span.tag demo
.content.main-width
p {{ thread.data }}
.content.main-width
input.title(v-model="thread.title")
textarea.data(v-model="thread.data", rows="32")
button.submit(@click="submit") 发表
.content.circumscription
input.title(v-model="thread.title")
textarea.data(v-model="thread.data", rows="32")
button.submit(@click="submit") 发表
</template>
<script>
@@ -31,6 +29,9 @@ export default {
return console.log("尚无内容");
}
this.$axios.post("/api/thread", this.thread).then((res) => {
if (res.status === 200) {
return this.$router.push("/");
}
console.log(res.data);
});
},

3
pages/thread/index.vue Normal file
View File

@@ -0,0 +1,3 @@
<template lang="pug">
.thread-index
</template>