Skip to content

Commit cd33507

Browse files
committed
初始化修改,加入sass
1 parent 45e8b62 commit cd33507

File tree

12 files changed

+138
-75
lines changed

12 files changed

+138
-75
lines changed

build/webpack.base.conf.js

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ module.exports = {
3737
loader: 'babel-loader',
3838
include: [resolve('src'), resolve('test')]
3939
},
40+
{
41+
test: /\.scss$/,
42+
loaders: ['style','css','sass']
43+
},
4044
{
4145
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
4246
loader: 'url-loader',

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@
3434
"friendly-errors-webpack-plugin": "^1.1.3",
3535
"html-webpack-plugin": "^2.28.0",
3636
"http-proxy-middleware": "^0.17.3",
37-
"webpack-bundle-analyzer": "^2.2.1",
38-
"semver": "^5.3.0",
39-
"shelljs": "^0.7.6",
37+
"node-sass": "^4.5.3",
4038
"opn": "^4.0.2",
4139
"optimize-css-assets-webpack-plugin": "^1.3.0",
4240
"ora": "^1.2.0",
4341
"rimraf": "^2.6.0",
42+
"sass-loader": "^6.0.6",
43+
"semver": "^5.3.0",
44+
"shelljs": "^0.7.6",
4445
"url-loader": "^0.5.8",
4546
"vue-loader": "^12.1.0",
4647
"vue-style-loader": "^3.0.1",
4748
"vue-template-compiler": "^2.3.3",
4849
"webpack": "^2.6.1",
50+
"webpack-bundle-analyzer": "^2.2.1",
4951
"webpack-dev-middleware": "^1.10.0",
5052
"webpack-hot-middleware": "^2.18.0",
5153
"webpack-merge": "^4.1.0"

src/App.vue

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div id="app">
3-
<img src="./assets/logo.png">
43
<router-view></router-view>
54
</div>
65
</template>
@@ -18,6 +17,5 @@ export default {
1817
-moz-osx-font-smoothing: grayscale;
1918
text-align: center;
2019
color: #2c3e50;
21-
margin-top: 60px;
2220
}
2321
</style>

src/components/Hello.vue

-53
This file was deleted.

src/components/backtotop.vue

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<h2>Essential Links</h2>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
name: 'hello',
11+
data () {
12+
return {
13+
msg: 'Welcome to Your Vue.js App'
14+
}
15+
}
16+
}
17+
</script>
18+
19+
<!-- Add "scoped" attribute to limit CSS to this component only -->
20+
<style scoped>
21+
h1, h2 {
22+
font-weight: normal;
23+
}
24+
25+
ul {
26+
list-style-type: none;
27+
padding: 0;
28+
}
29+
30+
li {
31+
display: inline-block;
32+
margin: 0 10px;
33+
}
34+
35+
a {
36+
color: #42b983;
37+
}
38+
</style>

src/components/header.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div>
3+
<div class="index">test</div>
4+
</div>
5+
</template>
6+
<script>
7+
8+
</script>
9+
<style>
10+
.index {
11+
width: 100%;
12+
background-color: #fff;
13+
margin-top: 40%;
14+
}
15+
</style>

src/components/loading.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div>
3+
<div class="index">test</div>
4+
</div>
5+
</template>
6+
<script>
7+
8+
</script>
9+
<style>
10+
.index {
11+
width: 100%;
12+
background-color: #fff;
13+
margin-top: 40%;
14+
}
15+
</style>

src/components/menu.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div>
3+
<div class="index">test</div>
4+
</div>
5+
</template>
6+
<script>
7+
8+
</script>
9+
<style>
10+
.index {
11+
width: 100%;
12+
background-color: #fff;
13+
margin-top: 40%;
14+
}
15+
</style>

src/router/index.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
import Vue from 'vue'
22
import Router from 'vue-router'
3-
import Hello from '@/components/Hello'
4-
3+
import index from '../views/index'
4+
import list from '../views/list'
5+
import topic from '../views/topic'
56
Vue.use(Router)
67

78
export default new Router({
89
routes: [
10+
{
11+
path:'/list',
12+
name:'list',
13+
component: list
14+
},
15+
{
16+
path:'/topic',
17+
name:'topic',
18+
component: topic
19+
},
920
{
1021
path: '/',
11-
name: 'Hello',
12-
component: Hello
22+
name: 'index',
23+
component: index
1324
}
1425
]
1526
})

src/views/index.vue

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<template>
2-
<div>
3-
<img class="index" src="../assets/images/index.png">
4-
</div>
2+
<div>index</div>
53
</template>
64
<script>
7-
require('../assets/scss/CV.scss');
8-
require('../assets/scss/iconfont/iconfont.css');
9-
require('../assets/scss/github-markdown.css');
10-
115
export default {
126
mounted() {
137
setTimeout(() => {
@@ -18,10 +12,6 @@
1812
}
1913
};
2014
</script>
21-
<style lang="scss">
22-
.index {
23-
width: 100%;
24-
background-color: #fff;
25-
margin-top: 40%;
26-
}
15+
<style>
16+
2717
</style>

src/views/list.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div>
3+
<div class="index">list<p>list</p></div>
4+
</div>
5+
</template>
6+
<script>
7+
8+
</script>
9+
<style lang="scss" scoped>
10+
.index {
11+
width: 100%;
12+
background-color: #fff;
13+
p{
14+
font-size: 100px;
15+
}
16+
}
17+
</style>

src/views/topic.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<div>
3+
<div class="index">topic</div>
4+
</div>
5+
</template>
6+
<script>
7+
8+
</script>
9+
<style>
10+
11+
</style>

0 commit comments

Comments
 (0)