소스 검색

Add new search route

sbkwgh 8 년 전
부모
커밋
08f6a72fed
2개의 변경된 파일31개의 추가작업 그리고 0개의 파일을 삭제
  1. 29 0
      src/components/routes/Search.vue
  2. 2 0
      src/main.js

+ 29 - 0
src/components/routes/Search.vue

@@ -0,0 +1,29 @@
+<template>
+	<div class='route_container'>
+		
+	</div>
+</template>
+
+<script>
+	import ThreadPost from '../ThreadPost'
+
+	import AjaxErrorHandler from '../../assets/js/errorHandler'
+
+	export default {
+		name: 'Search',
+		components: {
+			ThreadPost
+		},
+		mounted () {
+			this.$store.dispatch('setTitle', 'Search | ' + this.$route.params.q)
+		}
+	}
+</script>
+
+<style lang='scss' scoped>
+	@import '../../assets/scss/variables.scss';
+
+	.search {
+
+	}
+</style>

+ 2 - 0
src/main.js

@@ -16,6 +16,7 @@ import P from './components/routes/P'
 import Start from './components/routes/Start'
 import Thread from './components/routes/Thread'
 import ThreadNew from './components/routes/ThreadNew'
+import Search from './components/routes/Search'
 
 import User from './components/routes/User'
 import UserPosts from './components/routes/UserPosts'
@@ -44,6 +45,7 @@ const router = new VueRouter({
 		{ path: '/thread/:slug/:id', component: Thread },
 		{ path: '/thread/:slug/:id/:post_number', name: 'thread-post', component: Thread },
 		{ path: '/thread/new', component: ThreadNew },
+		{ path: '/search/:q', component: Search },
 		{ path: '/user/:username', redirect: '/user/:username/posts', component: User, children: [
 			{ path: 'posts', component: UserPosts },
 			{ path: 'threads', component: UserThreads }