cabinet/frontend/src/App.vue

63 lines
1.3 KiB
Vue
Raw Normal View History

2019-10-30 15:31:07 +00:00
<template>
<div id="app">
2019-11-01 17:09:17 +00:00
<b-navbar type="dark" variant="dark">
2019-11-08 01:54:00 +00:00
<b-navbar-brand>🗄 Cabinet</b-navbar-brand>
2019-11-01 17:09:17 +00:00
<b-navbar-nav>
<b-nav-item to="/">Home</b-nav-item>
<b-nav-item to="/console">Console</b-nav-item>
<b-nav-item to="/about">About</b-nav-item>
</b-navbar-nav>
2019-11-08 05:26:02 +00:00
<b-navbar-nav class="ml-auto">
<b-nav-form>
<b-button @click="newFile">+</b-button>
</b-nav-form>
</b-navbar-nav>
2019-11-01 17:09:17 +00:00
</b-navbar>
<Error/>
2019-10-30 15:31:07 +00:00
<router-view/>
</div>
</template>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
#nav {
padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
}
</style>
<script>
import Error from "./components/Error";
export default {
name: 'app',
components: {
Error
2019-11-08 05:26:02 +00:00
},
methods: {
newFile: function() {
this.$store.dispatch('newFile')
2019-11-08 05:35:20 +00:00
.catch(() => {})
2019-11-08 05:26:02 +00:00
.then(file => {
this.$store.dispatch('updateSearch')
this.$router.push({ name: 'console-slug', params: { slug: file.Slug }})
})
}
}
}
2019-11-08 01:54:00 +00:00
</script>