Skip to content

Vue with app menu #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"node": ">= 6.4.0"
},
"dependencies": {
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"axios": "^0.16.1",
"csshint": "^0.3.3",
"d3-format": "^1.2.1",
Expand All @@ -29,6 +27,9 @@
"san-router": "^1.1.1",
"san-store": "^1.0.1",
"san-update": "^2.1.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuetify": "^0.17.7",
"xlsx": "^0.11.3"
},
"devDependencies": {
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<template>
<div id="app">
<AppMenu>
</AppMenu>

<router-view></router-view>
<v-app>
<AppMenu>
</AppMenu>
</v-app>
</div>

</template>

<script>
Expand All @@ -26,7 +25,6 @@ export default {
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

120 changes: 69 additions & 51 deletions frontend/src/common/component/AppMenu.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,83 @@
<template>
<div>
AppMenu goes here
<p>{{ msg }} </p>

<div class="visual-dl-app-menu">
<!--<san-appbar title=" ">-->
<!--<san-menu slot="right">-->
<!--<san-menu-item-->
<!--s-for="item in items"-->
<!--class="{{selected === item.name ? 'sm-menu-item-selected' : ''}}"-->
<!--on-click="handleItemClick(item)"-->
<!--title="{{item.title}}" />-->
<!--</san-menu>-->
<!--</san-appbar>-->
<v-toolbar dark color="teal">
<v-toolbar-title class="appbar-menu-title"></v-toolbar-title>
<v-spacer></v-spacer>
<v-btn v-for="item in items" :key="item.name"
:class="[{'menu-item-selected': selected === item.name}, 'menu-item']"
@click="handleItemClick(item.name)"
>{{ item.title}}</v-btn>
</v-toolbar>
</div>
</div>
</template>

<script>
export default {
name: 'AppMenu',
data () {
return {
msg: 'Welcome to Your App Menu'
name: 'AppMenu',
data () {
return {
selected: 'scalars',
items: [
{
url: '/scalars',
title: 'SCALARS',
name: 'scalars'
},
{
url: '/images',
title: 'IMAGES',
name: 'images'
},
{
url: '/histograms',
title: 'HISTOGRAMS',
name: 'histograms'
},
{
url: '/graphs',
title: 'GRAPHS',
name: 'graphs'
}
]
}
},
methods: {
handleItemClick: function (name) {
this.selected = name
}
}
}
}
</script>

<style>
+prefix-classes(prefix)
.app-menu
width 100%
<style scoped>
.appbar-menu-title {
font-size: 24px;
flex: none;
margin-right: 50px;
background: url('./visualdl-logo.png') no-repeat;
background-size: cover;
width: 120px;
height: 50px;
}

.menu-item {
padding: 0 30px;
color: #fff;
opacity: 0.6;
display: flex;
flex-direction: row;
}

.menu-item:hover {
background: none;
opacity: 1;
}

.menu-item-selected {
color: #fff;
opacity: 1;
}

.visual-dl-app-menu
.sm-appbar-title
font-size 24px
flex none
margin-right 50px
.sm-appbar-title
background url('./visualdl-logo.png') no-repeat
background-size cover
width 120px
height 50px
.sm-appbar-right
width 100%
.sm-menu
width 100%
height 100%
display flex
flex-direction row
.sm-menu-item
padding 0 30px
.sm-menu-item-content
color #fff
opacity 0.6
.sm-menu-item:hover
background none
opacity 1
.sm-menu-item-selected
.sm-menu-item-content
color #fff
opacity 1
</style>
</style>
4 changes: 4 additions & 0 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import Vuetify from 'vuetify'
import('vuetify/dist/vuetify.min.css')
import AppMenu from '@/common/component/AppMenu'

Vue.config.productionTip = false

Vue.use(Vuetify)

/* eslint-disable no-new */
new Vue({
el: '#root',
Expand Down