Skip to content

Commit 2d6924f

Browse files
committed
upgrade to vue 2.0
1 parent 609bc8c commit 2d6924f

40 files changed

+599
-322
lines changed

404.html

Lines changed: 15 additions & 17 deletions
Large diffs are not rendered by default.

index.html

Lines changed: 15 additions & 17 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "portfolio",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "fnlCtrl's portfolio",
55
"license": "MIT",
66
"author": {
@@ -13,30 +13,33 @@
1313
},
1414
"dependencies": {
1515
"marked": "^0.3.5",
16-
"vue": "^1.0.21",
17-
"vue-i18n": "^2.4.1",
18-
"vue-router": "^0.7.13"
16+
"vue": "^2.0.0-rc.1",
17+
"vue-i18n": "^4.2.0",
18+
"vue-router": "^2.0.0-rc.3"
1919
},
2020
"devDependencies": {
2121
"autoprefixer-loader": "^3.2.0",
22-
"babel-core": "^6.7.6",
22+
"babel-core": "^6.13.2",
2323
"babel-loader": "^6.2.4",
2424
"babel-preset-es2015": "^6.6.0",
2525
"css-loader": "^0.23.1",
2626
"extract-text-webpack-plugin": "^1.0.1",
2727
"file-loader": "^0.8.5",
2828
"gulp": "^3.9.1",
2929
"gulp-inline": "^0.1.1",
30+
"html-loader": "^0.4.3",
3031
"less": "^2.6.1",
3132
"less-loader": "^2.2.3",
3233
"raw-loader": "^0.5.1",
3334
"style-loader": "^0.13.1",
35+
"svg-sprite-loader": "0.0.26",
3436
"url-loader": "^0.5.7",
35-
"vue-html-loader": "^1.2.2",
36-
"webpack": "^1.12.14",
37+
"vue-loader": "^9.3.2",
38+
"webpack": "^1.13.1",
3739
"webpack-dev-server": "^1.14.1"
3840
},
3941
"scripts": {
42+
"optimize-icons": "svgo --config=svgo.config.yml src/icons",
4043
"start": "webpack-dev-server --config webpack.config.js",
4144
"build": "webpack -p && gulp build && cp index.html 404.html"
4245
},

src/components/gallery/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import MdT from 'md-transform';
44

55
export default {
66
template,
7-
replace: false,
87
props: {
98
data: {
109
type: Object,
@@ -13,7 +12,7 @@ export default {
1312
},
1413
methods: {
1514
redirect({target: {href}}) {
16-
href && this.$route.router.go(href.replace(window.location.origin,''));
15+
href && this.$router.push(href.replace(window.location.origin,''));
1716
}
1817
}
1918
};

src/components/gallery/style.less

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
gallery {
1+
.gallery {
22
height: 100%;
33
display: block;
44
position: relative;
5-
overflow: auto;
65
column-count: 100;
76
column-width: 200px;
87
column-gap: 20px;
9-
&::-webkit-scrollbar-track {
10-
background: linear-gradient(
11-
to bottom,
12-
transparent 0%,
13-
transparent 30%,
14-
rgba(0, 0, 0, 0.3) 50%,
15-
transparent 70%,
16-
transparent 100%
17-
)
18-
}
19-
&::-webkit-scrollbar {
20-
width: 6px;
21-
height: 6px;
22-
}
23-
24-
&::-webkit-scrollbar-thumb {
25-
border-radius: 10px;
26-
background: rgba(0, 0, 0, 0.6);
27-
}
288
ul {
299
display: none;
3010
}

src/components/gallery/template.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
<div class="item" v-for="(title, item) in data" @click.capture.prevent="redirect">{{{ item.html }}}</div>
1+
<div class="gallery">
2+
<div class="item"
3+
v-for="(item, title) in data"
4+
v-html="item.html"
5+
@click.capture.prevent="redirect"></div>
6+
</div>

src/components/icon/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
export default {
2-
github: require('../../icons/ic-github.svg'),
3-
gplus: require('../../icons/ic-gplus.svg'),
4-
star: require('../../icons/ic-star.svg'),
5-
zhihu: require('../../icons/ic-zhihu.svg')
1+
module.exports = {
2+
props: {
3+
name: {
4+
type: String,
5+
required: true
6+
}
7+
},
8+
template: `<svg icon><use v-bind="{'xlink:href': name}"></use></svg>`
69
};

src/components/navigation/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import template from './template.html';
33

44
export default {
55
template,
6-
replace: false,
76
data: () => ({
87
views: [
98
"designs",

src/components/navigation/style.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
navigation {
1+
.navigation {
22
position: fixed;
33
width: auto;
44
height: auto;
55
z-index: 98;
66
}
77

88
@media (min-width: 640px) {
9-
navigation {
9+
.navigation {
1010
top: 50%;
1111
height: 100px;
1212
margin-top: -50px;
@@ -59,7 +59,7 @@ navigation {
5959
}
6060

6161
@media (max-width: 640px) {
62-
navigation {
62+
.navigation {
6363
padding: 0 40px;
6464
width: 100%;
6565
top: 0;
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
<a class="dot" v-for="view in views" v-link="{path: '/' + view, activeClass: 'active'}">
2-
<span class="hint">{{ view }}</span>
3-
</a>
1+
<div class="navigation">
2+
<!--activeClass-->
3+
<router-link class="dot" v-for="view in views" active-class="active" :to="{path: '/' + view}">
4+
<span class="hint">{{ view }}</span>
5+
</router-link>
6+
</div>

0 commit comments

Comments
 (0)