Skip to content

Commit af5bb65

Browse files
author
Kirill Serebrennikov
committed
add links
1 parent b1643c7 commit af5bb65

33 files changed

+1639
-188
lines changed

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"dependencies": {
1111
"core-js": "^3.6.5",
12+
"materialize-css": "^1.0.0-rc.2",
1213
"register-service-worker": "^1.7.1",
1314
"vue": "^2.6.11",
1415
"vue-router": "^3.2.0",

public/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
89
<title><%= htmlWebpackPlugin.options.title %></title>
910
</head>
1011
<body>

src/.editorconfig

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Matches multiple files with brace expansion notation
12+
# Set default charset
13+
[*.{js,py}]
14+
charset = utf-8
15+
16+
# 4 space indentation
17+
[*]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
# Tab indentation (no size specified)
22+
[Makefile]
23+
indent_style = tab
24+
25+
# Indentation override for all JS under lib directory
26+
[lib/**.js]
27+
indent_style = space
28+
indent_size = 2
29+
30+
# Matches the exact files either package.json or .travis.yml
31+
[{package.json,.travis.yml}]
32+
indent_style = space
33+
indent_size = 2

src/App.vue

+20-24
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
<template>
22
<div id="app">
3-
<div id="nav">
4-
<router-link to="/">Home</router-link> |
5-
<router-link to="/about">About</router-link>
6-
</div>
7-
<router-view />
3+
<component :is="layout">
4+
<router-view />
5+
</component>
6+
87
</div>
98
</template>
109

11-
<style lang="scss">
12-
#app {
13-
font-family: Avenir, Helvetica, Arial, sans-serif;
14-
-webkit-font-smoothing: antialiased;
15-
-moz-osx-font-smoothing: grayscale;
16-
text-align: center;
17-
color: #2c3e50;
10+
<script>
11+
import EmptyLayout from '@/layout/EmptyLayout'
12+
import MainLayout from '@/layout/MainLayout'
13+
export default {
14+
computed: {
15+
layout() {
16+
return (this.$route.meta.layout || 'empty') + '-layout'
17+
}
18+
},
19+
components: {
20+
EmptyLayout, MainLayout
21+
}
1822
}
23+
</script>
1924

20-
#nav {
21-
padding: 30px;
22-
23-
a {
24-
font-weight: bold;
25-
color: #2c3e50;
26-
27-
&.router-link-exact-active {
28-
color: #42b983;
29-
}
30-
}
31-
}
25+
<style lang="scss">
26+
@import '~materialize-css/dist/css/materialize.min.css';
27+
@import 'assets/index.css';
3228
</style>

src/assets/index.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/logo.png

-6.69 KB
Binary file not shown.

src/components/HelloWorld.vue

-138
This file was deleted.

src/components/app/Navbar.vue

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<nav class="navbar orange lighten-1">
3+
<div class="nav-wrapper">
4+
<div class="navbar-left">
5+
<a href="#" @click.prevent="$emit('click')">
6+
<i class="material-icons black-text">dehaze</i>
7+
</a>
8+
<span class="black-text">12.12.12</span>
9+
</div>
10+
11+
<ul class="right hide-on-small-and-down">
12+
<li>
13+
<a class="dropdown-trigger black-text" href="#" data-target="dropdown">
14+
USER NAME
15+
<i class="material-icons right">arrow_drop_down</i>
16+
</a>
17+
18+
<ul id="dropdown" class="dropdown-content">
19+
<li>
20+
<a href="#" class="black-text">
21+
<i class="material-icons">account_circle</i>Профиль
22+
</a>
23+
</li>
24+
<li class="divider" tabindex="-1"></li>
25+
<li>
26+
<a href="#" class="black-text">
27+
<i class="material-icons">assignment_return</i>Выйти
28+
</a>
29+
</li>
30+
</ul>
31+
</li>
32+
</ul>
33+
</div>
34+
</nav>
35+
</template>

src/components/app/Sidebar.vue

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<template>
2+
<ul class="sidenav app-sidenav" :class="{open: value}">
3+
<router-link v-for="link in links" :key="link.url" tag="li" active-class="active" :to="link.url" :exact="link.exact">
4+
<a href="#" class="waves-effect waves-orange pointer">{{link.title}}</a>
5+
</router-link>
6+
7+
</ul>
8+
</template>
9+
10+
<script>
11+
export default {
12+
props: ['value'],
13+
data: () => ({
14+
links: [
15+
{title: 'Счет', url: '/', exact: true},
16+
{title: 'История', url: '/history'},
17+
{title: 'Планирование', url: '/planning'},
18+
{title: 'Новая запись', url: '/record'},
19+
{title: 'Категории', url: '/categories'},
20+
]
21+
})
22+
}
23+
</script>
24+
25+

src/layout/EmptyLayout.vue

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="grey darken-1 empty-layout">
3+
<router-view />
4+
</div>
5+
</template>

src/layout/MainLayout.vue

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<template>
2+
<div class="app-main-layout">
3+
<Navbar @click="isOpen = !isOpen" />
4+
<Sidebar v-model="isOpen" />
5+
6+
<main class="app-content" :class="{full: !isOpen}">
7+
<div class="app-page">
8+
<router-view />
9+
</div>
10+
</main>
11+
12+
<div class="fixed-action-btn">
13+
<a class="btn-floating btn-large blue" href="#">
14+
<i class="large material-icons">add</i>
15+
</a>
16+
</div>
17+
</div>
18+
</template>
19+
20+
<script>
21+
import Navbar from "@/components/app/Navbar";
22+
import Sidebar from "@/components/app/Sidebar";
23+
24+
export default {
25+
name: "main-layout",
26+
data: () => ({
27+
isOpen: true
28+
}),
29+
components: {
30+
Navbar,
31+
Sidebar
32+
}
33+
};
34+
</script>

src/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import App from "./App.vue";
33
import "./registerServiceWorker";
44
import router from "./router";
55
import store from "./store";
6+
import 'materialize-css/dist/js/materialize.min'
67

78
Vue.config.productionTip = false;
89

0 commit comments

Comments
 (0)