Skip to content

Commit b050093

Browse files
committed
Making progress :woot:
1 parent ab63df9 commit b050093

15 files changed

+318
-84
lines changed

aliases.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const path = require('path')
2+
3+
function resolveSrc (_path) {
4+
return path.join(__dirname, _path)
5+
}
6+
7+
const aliases = {
8+
'@': 'src',
9+
'@router': 'src/router',
10+
'@views': 'src/router/views',
11+
'@layouts': 'src/router/layouts',
12+
'@components': 'src/components',
13+
'@assets': 'src/assets'
14+
// '@utils': 'src/utils',
15+
// '@state': 'src/state',
16+
// '@design': 'src/design/index.scss'
17+
}
18+
19+
module.exports = {
20+
webpack: {},
21+
jest: {}
22+
}
23+
24+
for (const alias in aliases) {
25+
module.exports.webpack[alias] = resolveSrc(aliases[alias])
26+
module.exports.jest['^' + alias + '/(.*)$'] =
27+
'<rootDir>/' + aliases[alias] + '/$1'
28+
}

src/App.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
<template>
22
<div id="app">
3-
<div id="nav">
3+
<!-- <div id="nav">
44
<router-link to="/">Home</router-link> |
55
<router-link to="/about">About</router-link>
6-
</div>
6+
</div> -->
77
<router-view/>
88
</div>
99
</template>
1010

1111
<style lang="scss">
12+
@import "styles/main.scss";
13+
1214
#app {
13-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
15+
font-family: "Avenir", Helvetica, Arial, sans-serif;
1416
-webkit-font-smoothing: antialiased;
1517
-moz-osx-font-smoothing: grayscale;
1618
text-align: center;

src/components/HelloWorld.vue

-60
This file was deleted.

src/components/ProductGrid.vue

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<div class="grid-container">
3+
4+
<div class="grid-image primary">
5+
<img src="https://placehold.it/250x250/05AABA/000000?text=PizzaPizzaPizza" />
6+
</div>
7+
<div class="grid-image secondary">
8+
<img src="https://placehold.it/250x250/05AABA/000000?text=PizzaPizzaPizza" />
9+
</div>
10+
<div class="grid-image thirdary">
11+
<img src="https://placehold.it/250x250/05AABA/000000?text=PizzaPizzaPizza" />
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script>
17+
export default {
18+
name: 'ProductGrid',
19+
props: {
20+
msg: String
21+
}
22+
}
23+
</script>
24+
25+
<!-- Add "scoped" attribute to limit CSS to this component only -->
26+
<style lang="scss" scoped>
27+
.grid-container {
28+
display: grid;
29+
grid-template-columns: 50% 50%;
30+
grid-template:
31+
"primary secondary"
32+
"primary thirdary";
33+
}
34+
35+
.primary {
36+
grid-area: primary;
37+
}
38+
.secondary {
39+
grid-area: secondary;
40+
}
41+
.thirdary {
42+
grid-area: thirdary;
43+
}
44+
</style>

src/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue'
22
import App from './App.vue'
3-
import router from './router'
3+
import router from '@router/routes.js'
44
import store from './store'
55
import './registerServiceWorker'
66

src/router/layouts/Master.vue

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<template>
2+
<div class="layout">
3+
<section class="header">
4+
</section>
5+
<main class="main">
6+
<slot></slot>
7+
</main>
8+
9+
<section class="footer">
10+
11+
</section>
12+
</div>
13+
</template>
14+
15+
<script>
16+
export default {
17+
name: 'MasterLayout'
18+
}
19+
</script>
20+
21+
<style lang="scss">
22+
@import "../../styles/global-variables.scss";
23+
24+
.layout {
25+
display: grid;
26+
grid-template-columns: 25% 25% 25% 25%;
27+
grid-template-rows: auto;
28+
grid-template-areas:
29+
"header header header header"
30+
"main main main main"
31+
"footer footer footer footer";
32+
}
33+
34+
.header {
35+
grid-area: header;
36+
background-color: map-get($brand, primary);
37+
min-height: 60px;
38+
39+
@media (max-width: 600px) {
40+
grid-area: footer;
41+
}
42+
}
43+
44+
.main {
45+
grid-area: main;
46+
}
47+
48+
.footer {
49+
grid-area: footer;
50+
background-color: map-get($brand, primary);
51+
}
52+
</style>

src/router.js src/router/routes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Vue from 'vue'
22
import Router from 'vue-router'
3-
import Home from './views/Home.vue'
4-
import About from './views/About.vue'
3+
import Home from '@views/Home.vue'
4+
import About from '@views/About.vue'
55

66
Vue.use(Router)
77

File renamed without changes.

src/router/views/Home.vue

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<cdd-master-layout>
3+
<div class="home">
4+
<img src="@assets/logo.png">
5+
<cdd-product-grid msg="Welcome to Your PizzaScript"/>
6+
</div>
7+
</cdd-master-layout>
8+
</template>
9+
10+
<script>
11+
import CddMasterLayout from '@layouts/Master.vue';
12+
import CddProductGrid from '@components/ProductGrid.vue';
13+
14+
export default {
15+
name: 'home',
16+
components: {
17+
CddMasterLayout,
18+
CddProductGrid
19+
}
20+
}
21+
</script>

src/styles/_box-model.scss

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* apply a natural box layout model to all elements, but allowing components to change */
2+
3+
html {
4+
box-sizing: border-box;
5+
}
6+
7+
*,
8+
*:before,
9+
*:after {
10+
box-sizing: inherit;
11+
}

0 commit comments

Comments
 (0)