Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
feat(demo): Add top-app-bar demo
Browse files Browse the repository at this point in the history
  • Loading branch information
matsp committed Mar 8, 2018
1 parent 53f9e80 commit c29f8e9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
4 changes: 4 additions & 0 deletions demo/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export default new VueRouter({
{
path: '/textfield',
component: () => import('views/TextfieldView')
},
{
path: '/topappbar',
component: () => import('views/TopAppBarView')
}
]
})
11 changes: 5 additions & 6 deletions demo/store/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,21 @@ const state = {
text: 'Textfield',
route: '/textfield',
icon: 'code'
},
topappbar: {
text: 'TopAppBar',
route: '/topappbar',
icon: 'code'
}
}
}

const getters = {}

const mutations = {
TOGGLE_DARKTHEME (state) {
state.darkTheme ? (state.darkTheme = false) : (state.darkTheme = true)
}
}

const actions = {
toggleDarkTheme (context) {
context.commit(types.TOGGLE_DARKTHEME)
}
}

export default { state, getters, mutations, actions }
1 change: 0 additions & 1 deletion demo/store/modules/mutation-types.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
export const TOGGLE_DARKTHEME = 'TOGGLE_DARKTHEME'
40 changes: 40 additions & 0 deletions demo/views/TopAppBarView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<m-layout-grid-inner>
<m-layout-grid-cell :span="12">
<m-typo-display :level="1">TopAppBar</m-typo-display>
<m-typo-body :level="2">
<a href="https://github.com/matsp/material-components-vue/blob/master/components/top-app-bar">
https://github.com/matsp/material-components-vue/blob/master/components/top-app-bar
</a>
</m-typo-body>
</m-layout-grid-cell>
<m-layout-grid-cell :span="8">
<m-top-app-bar>
<m-icon
icon="menu"
slot="navigation"/>
<div>Title</div>
<m-icon
icon="file_download"
slot="actions"/>
</m-top-app-bar>
</m-layout-grid-cell>
</m-layout-grid-inner>
</template>

<script>
import Vue from 'vue'
import Icon from '../../dist/icon'
import TopAppBar from '../../dist/top-app-bar'
Vue.use(Icon)
Vue.use(TopAppBar)
export default {
}
</script>

<style lang="scss">
@import "../../dist/top-app-bar/styles";
</style>

0 comments on commit c29f8e9

Please sign in to comment.