Created
October 27, 2018 18:16
-
-
Save viniciussvl/1d5d2ba18bddd156ed7093dba9e82c17 to your computer and use it in GitHub Desktop.
vue router n funciona
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<h3>Dashboard</h3> | |
</div> | |
</template> | |
<script> | |
// import VueExtendLayouts from "vue-extend-layout"; | |
export default { | |
name: "Dashboard", | |
// components: { VueExtendLayouts } | |
}; | |
</script> | |
<style> | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<header> | |
<v-toolbar> | |
<v-toolbar-side-icon></v-toolbar-side-icon> | |
<v-toolbar-title>Application</v-toolbar-title> | |
<v-spacer></v-spacer> | |
<v-toolbar-items class="hidden-sm-and-down"> | |
<v-btn flat>Home</v-btn> | |
<v-btn flat>Login</v-btn> | |
</v-toolbar-items> | |
</v-toolbar> | |
</header> | |
<div class="container"> | |
<router-view /> | |
</div> | |
<footer /> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: "default" // id of the layout (required) | |
}; | |
</script> | |
<style> | |
/* your style */ | |
</style> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<h3>Login</h3> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Login', | |
} | |
</script> | |
<style> | |
</style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import './plugins/vuetify' | |
import router from './router' | |
Vue.config.productionTip = false | |
/* eslint-disable no-new */ | |
new Vue({ | |
router, | |
}).$mount('#app') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Router from 'vue-router' | |
import Dashboard from './pages/Dashboard.vue' | |
import Login from './pages/Login.vue' | |
Vue.use(Router) | |
export default new Router({ | |
routes: [{ | |
path: '/', | |
name: 'Dashboard', | |
component: Dashboard, | |
meta: { | |
layout: 'default' | |
} | |
}, | |
{ | |
path: '/login', | |
name: 'Login', | |
component: Login, | |
} | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment