Updates CSS for a better link tracker app

master
androiddrew 7 years ago
parent bdfc51c3d9
commit 5feadc1d72

@ -1,29 +1,11 @@
<template> <template>
<div id="app"> <div id="app">
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/> <router-view/>
</div> </div>
</template> </template>
<style lang="scss"> <style>
#app { #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif; font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
#nav {
padding: 30px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
} }
}
</style> </style>

@ -1,56 +1,76 @@
<template> <template>
<div class="hello"> <div class="hello">
<h1>{{ msg }}</h1> <div class="left">
<p> <h1>{{ title }}</h1>
For guide and recipes on how to configure / customize this project,<br> <ul>
check out the <li v-for="(link, index) in links" v-bind:key="index">
<a href="https://github.com/vuejs/vue-cli/tree/dev/docs" target="_blank">vue-cli documentation</a>. {{ link }}
</p> </li>
<h3>Installed CLI Plugins</h3> </ul>
<ul> </div>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank">babel</a></li> <div class="right">
</ul> <stats></stats>
<h3>Essential Links</h3> </div>
<ul>
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org/en/essentials/getting-started.html" target="_blank">vue-router</a></li>
<li><a href="https://vuex.vuejs.org/en/intro.html" target="_blank">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org/en" target="_blank">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
</ul>
</div> </div>
</template> </template>
<script> <script>
import Stats from '@/components/Stats.vue'
import { mapState } from 'vuex'
export default { export default {
name: 'HelloWorld', name: 'HelloWorld',
props: { components:{
msg: String Stats
} },
computed: {
...mapState([
'title',
'links'
]),
// Other stuff
},
} }
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss"> <style>
h3 { html, #app, .home {
margin: 40px 0 0; height: 100%;
} }
ul { body {
list-style-type: none; background-color: #F4F4F4;
padding: 0; margin: 0;
} height: 100%;
li { }
display: inline-block;
margin: 0 10px; .hello {
} display: grid;
a { grid-template-columns: repeat(2, 50%);
color: #42b983; grid-template-rows: 100%;
} grid-template-areas:
"left right";
height: 100%;
}
.left, .right {
padding: 30px;
}
ul {
list-style-type: none;
padding: 0;
}
ul li {
padding: 20px;
background: white;
margin-bottom: 8px;
}
.right {
grid-area: right;
background-color: #E9E9E9;
}
</style> </style>

@ -0,0 +1,39 @@
<template>
<div class="stats">
<h1>A different component</h1>
<p>There are currently {{ countLinks }} links</p>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'Stats',
computed: {
...mapGetters([
'countLinks'
]),
// Other stuff
},
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

@ -5,7 +5,15 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
title: 'My Custom Title',
links: [
'https://google.com',
'https://coursetro.com',
'https://youtube.com',
]
},
getters: {
countLinks: state => { return state.links.length }
}, },
mutations: { mutations: {

@ -1,6 +1,5 @@
<template> <template>
<div class="home"> <div class="home">
<img src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/> <HelloWorld msg="Welcome to Your Vue.js App"/>
</div> </div>
</template> </template>

Loading…
Cancel
Save