浏览代码

Show description on index page

sbkwgh 8 年之前
父节点
当前提交
14cae21e66
共有 3 个文件被更改,包括 16 次插入0 次删除
  1. 1 0
      src/App.vue
  2. 12 0
      src/components/routes/Index.vue
  3. 3 0
      src/store/index.js

+ 1 - 0
src/App.vue

@@ -301,6 +301,7 @@
 			this.axios.get('/api/v1/settings')
 				.then(res => {
 					this.$store.commit('setForumName', res.data.forumName)
+					this.$store.commit('setForumDescription', res.data.forumDescription)
 				}).catch(err => {
 					if(err.response.data.errors[0].name === 'noSettings') {
 						this.$router.push('/start')

+ 12 - 0
src/components/routes/Index.vue

@@ -1,5 +1,8 @@
 <template>
 	<div class='route_container'>
+		<div class='forum_description' v-if='$store.state.meta.description'>
+			{{$store.state.meta.description}}
+		</div>
 		<div class='thread_sorting'>
 			<select-options
 				:options='filterOptions'
@@ -216,6 +219,15 @@
 	@import '../../assets/scss/elementStyles.scss';
 	@import '../../assets/scss/variables.scss';
 
+	.forum_description {
+		padding: 1rem;
+		margin-bottom: 2rem;
+		background-color: #fff;
+		border-radius: 0.25rem;
+		
+		@extend .shadow_border;
+	}
+
 	.threads_main {
 		display: flex;
 	}

+ 3 - 0
src/store/index.js

@@ -70,6 +70,9 @@ export default new Vuex.Store({
 		setForumName (state, value) {
 			state.meta.name = value
 		},
+		setForumDescription (state, value) {
+			state.meta.description = value
+		},
 		addCategories (state, value) {
 			if(Array.isArray(value)) {
 				state.meta.categories.push(...value)