Skip to content

Instantly share code, notes, and snippets.

@stav
Created September 30, 2017 21:40
Show Gist options
  • Save stav/359606e1e7343d665fd38f6adaad4f24 to your computer and use it in GitHub Desktop.
Save stav/359606e1e7343d665fd38f6adaad4f24 to your computer and use it in GitHub Desktop.
Vuetify.js
<div id="app">
<v-app>
<v-navigation-drawer
persistent
:mini-variant="miniVariant"
:clipped="clipped"
v-model="drawer"
>
<v-list>
<v-list-item
v-for="(item, i) in items"
:key="i"
>
<v-list-tile value="true">
<v-list-tile-action>
<v-icon light v-html="item.icon"></v-icon>
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title v-text="item.title"></v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</v-list-item>
</v-list>
</v-navigation-drawer>
<v-toolbar>
<v-toolbar-side-icon @click.native.stop="drawer = !drawer"></v-toolbar-side-icon>
<v-btn
icon
@click.native.stop="miniVariant = !miniVariant"
>
<v-icon v-html="miniVariant ? 'chevron_right' : 'chevron_left'"></v-icon>
</v-btn>
<v-btn
icon
@click.native.stop="clipped = !clipped"
>
<v-icon>web</v-icon>
</v-btn>
<v-btn
icon
@click.native.stop="fixed = !fixed"
>
<v-icon>remove</v-icon>
</v-btn>
<v-toolbar-title v-text="title"></v-toolbar-title>
<v-spacer></v-spacer>
<v-btn
icon
@click.native.stop="rightDrawer = !rightDrawer"
>
<v-icon>menu</v-icon>
</v-btn>
</v-toolbar>
<main>
<v-container fluid>
<page></page>
</v-container>
</main>
<v-navigation-drawer
temporary
:right="right"
v-model="rightDrawer"
>
<v-list>
<v-list-item>
<v-list-tile @click.native="right = !right">
<v-list-tile-action>
<v-icon light>more_vert</v-icon>
</v-list-tile-action>
<v-list-tile-title>Switch drawer (click me)</v-list-tile-title>
</v-list-tile>
</v-list-item>
</v-list>
</v-navigation-drawer>
<v-footer :fixed="fixed">
<span>&copy; 2017 with <v-icon light>stop</v-icon> by demvount</span>
</v-footer>
</v-app>
</div>
<template id="page">
<v-layout column align-center>
<div>
<img src="https://raw.githubusercontent.com/vuetifyjs/simple/master/template/v.png" alt="Vuetify.js" class="mb-5" height="100px" />
</div>
<blockquote>
&#8220;First, solve the problem. Then, write the code.&#8221;
<footer>
<small>
<em>&mdash;John Johnson</em>
</small>
</footer>
</blockquote>
</v-layout>
</template>
Vue.component('page', {
template: '#page'
})
new Vue({
el: '#app',
data: {
clipped: true,
drawer: false,
fixed: true,
items: [
{ icon: 'bubble_chart', title: 'Inspire' },
{ icon: 'language', title: 'Test' },
{ icon: 'more_vert', title: 'Test' },
],
miniVariant: false,
right: true,
rightDrawer: false,
title: 'Vuetify.js'
}
})
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuetify/dist/vuetify.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel="stylesheet" />
<link href="https://unpkg.com/vuetify/dist/vuetify.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment