renaming gifs, adding create post element
This commit is contained in:
BIN
nginx/vue/public/img/stamps/azudio.gif
Normal file
BIN
nginx/vue/public/img/stamps/azudio.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
nginx/vue/public/img/stamps/miku.gif
Normal file
BIN
nginx/vue/public/img/stamps/miku.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
BIN
nginx/vue/public/img/stamps/portal.gif
Normal file
BIN
nginx/vue/public/img/stamps/portal.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 238 KiB |
BIN
nginx/vue/public/img/stamps/utau.gif
Normal file
BIN
nginx/vue/public/img/stamps/utau.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
32
nginx/vue/src/components/admin/CreatePost.vue
Normal file
32
nginx/vue/src/components/admin/CreatePost.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, computed } from "vue";
|
||||||
|
import axios from "axios";
|
||||||
|
import { useAuthStore } from "@/stores/auth";
|
||||||
|
|
||||||
|
const auth = useAuthStore();
|
||||||
|
const title = ref("");
|
||||||
|
const content = ref("");
|
||||||
|
|
||||||
|
async function post() {
|
||||||
|
try {
|
||||||
|
const res = await axios.post("/api/posts", {
|
||||||
|
title: title.value,
|
||||||
|
content: content.value,
|
||||||
|
});
|
||||||
|
title.value = "";
|
||||||
|
content.value = "";
|
||||||
|
console.log(res.data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div v-if="auth.loggedIn">
|
||||||
|
<h1>Create Post</h1>
|
||||||
|
<input type="text" v-model="title" placeholder="Title" />
|
||||||
|
<textarea v-model="content" placeholder="Content"></textarea>
|
||||||
|
<button @click="post">Upload</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user