このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
076server/resources/assets/js/components/site/components/index.vue

62 行
1.9 KiB
Vue

<template>
<div :class="'within' + (public_status !== 0 ? ' wny' : '')">
<div :class="'bar' + (public_status !== 0 ? ' bny' : '')" @click="goto('/blog/' + post)">
{{ title }}
</div>
</div>
</template>
<script>
import Vue from 'vue';
import Cookie from 'js-cookie';
// import NewPost from './newpost';
import auth from '../../../auth';
export default {
//components: { NewPost },
props: { post: '', index: 0 },
data: function () {
return {
slug: this.post,
title: '',
public_status: 0,
priv: []
}
},
created: function () {
axios.post('/api/auth/getpermissions', { kero_token: Cookie.get('kero_token') }).then(res => {
res.data.forEach(cb => {
this.priv['ap'] = cb.blg_addpost;
});
}).then(() => { this.getPost(); });
},
methods: {
goto: function (page) {
this.$router.push(page);
this.$emit('refresh-page', true);
},
getPost: function () {
axios.get('/api/rpc/site/post/get/slug/' + this.post, { params: { kero_token: Cookie.get('kero_token') } }).then(res => {
res.data.forEach(cb => {
this.title = cb.title;
this.public_status = cb.public_status;
});
});
}
}
}
</script>
<style scoped>
.within { margin: 0 auto; }
.wny { border: solid 2px #ed1515; box-shadow: 0px 0px 20px 10px rgba(237,21,21,1); }
.bny, .cny { background-color: #da4453; border-bottom: solid 2px #ed1515; }
.mny { background-color: #c0392b; border-bottom: solid 2px #ed1515; }
.new { background-color: #2c3e50; margin: 10px auto; padding: 0; }
.head > div { margin: 5px 0; }
.new-head, .new-body { padding: 10px; }
.new-head { border: 2px solid #3daee9; background-color: #34495e; }
.new-body { border-bottom: 2px solid #3daee9; border-left: 2px solid #3daee9; border-right: 2px solid #3daee9; }
</style>