Browse Source

Move modal to app.vue rather than specific route

sbkwgh 8 years ago
parent
commit
ef9becea93
2 changed files with 27 additions and 16 deletions
  1. 27 1
      src/App.vue
  2. 0 15
      src/components/routes/Index.vue

+ 27 - 1
src/App.vue

@@ -1,5 +1,25 @@
 <template>
 	<div id='app'>
+		<modal-window :showModal='showLoginSignupModal'>
+			<tab-view :tabs='["Sign up", "Login"]'>
+				<div slot='first'>
+					text 1<br/>
+					text 1<br/>
+					text 1<br/>
+					text 1<br/>
+					text 1<br/>
+					text 1<br/>
+				</div>
+				<div slot='second'>
+					text 2<br/>
+					text 2<br/>
+					text 2<br/>
+					text 2<br/>
+					text 2<br/>
+					text 2<br/>
+				</div>
+			</tab-view>
+		</modal-window>
 		<header class='header'>
 			<div class='header__group'>
 				<div class='logo'>{{meta.name}}</div>
@@ -22,15 +42,21 @@
 </template>
 
 <script>
+	import ModalWindow from './components/ModalWindow'
+	import TabView from './components/TabView'
+
 	export default {
 		name: 'app',
 		components: {
+			ModalWindow,
+			TabView
 		},
 		data () {
 			return {
 				meta: {
 					name: 'Forum'
-				}
+				},
+				showLoginSignupModal: true
 			}
 		}
 	}

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

@@ -1,17 +1,5 @@
 <template>
 	<div class='index'>
-		<modal-window :showModal='showModal'>
-			<tab-view :tabs='["Sign up", "Login"]'>
-				<div slot='first'>
-					text 1
-				</div>
-				<div slot='second'>
-					text 2
-				</div>
-			</tab-view>
-		</modal-window>
-
-
 		<div class='thread_sorting'>
 			<select-button style='margin-right: 1rem' v-model='selected' :options='categories'></select-button>
 			<div class='button button--orange'>New</div>
@@ -50,14 +38,12 @@
 
 <script>
 	import SelectButton from '../SelectButton'
-	import ModalWindow from '../ModalWindow'
 	import TabView from '../TabView'
 
 	export default {
 		name: 'index',
 		components: {
 			SelectButton,
-			ModalWindow,
 			TabView
 		},
 		data () {
@@ -70,7 +56,6 @@
 
 			return {
 				selected: null,
-				showModal: true,
 				categories
 			}
 		}