Skip to content

Commit b1bfa79

Browse files
committed
add vuex example
1 parent 52f6e5d commit b1bfa79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+736
-40
lines changed

example/.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
2+
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"axios": "^0.16.2",
1818
"babel-polyfill": "^6.23.0",
1919
"blueimp-md5": "^2.7.0",
20+
"normalize.css": "^7.0.0",
2021
"qs": "^6.5.0",
2122
"vee-validate": "^2.0.0-rc.6",
2223
"vue": "^2.3.4",

example/src/components/pages/app/app.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@import "base/base";
22

3-
#app {
4-
margin-top: 60px;
3+
.app {
4+
min-height: 100vh;
5+
background: #f5f5f5;
56
-webkit-font-smoothing: antialiased;
67
-moz-osx-font-smoothing: grayscale;
78
font-family: "Avenir", Helvetica, Arial, sans-serif;
8-
text-align: center;
99

1010
a {
1111
color: $color-primary;
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
2-
<div id="app">
3-
<img src="~assets/images/logo.png">
4-
<router-view></router-view>
2+
<div id="app" class="app">
3+
<router-view :key="$route.fullPath"></router-view>
54
</div>
65
</template>
76
<style src="./app.scss" lang="scss"></style>
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
@import "base/base";
2-
3-
.h3 {
4-
color: goldenrod;
5-
}

example/src/components/tags/hello/hello.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<div>
33
<h1>Hello, {{ name }}</h1>
44
<slot></slot>
5-
<h3 class="h3">fff</h3>
65
</div>
76
</template>
87
<style src="./hello.scss" lang="scss" scoped></style>
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
@import "base/base";
22

33
.view-home {
4-
color: red;
4+
text-align: center;
55

6-
.hello {
7-
color: green;
6+
img {
7+
margin-top: 60px;
8+
}
89

9-
/deep/ {
10-
.h3 {
11-
color: #0f8;
12-
}
13-
}
10+
.hello,
11+
h2 {
12+
margin: 20px 0;
1413
}
1514

16-
.h2 {
17-
color: blue;
15+
.links {
16+
a {
17+
margin: 0 15px;
18+
text-decoration: underline;
19+
}
1820
}
1921
}
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
22
<div class="view-home">
3-
<hello name="Vue-Typescript" class="hello">
4-
<h2 class="h2">This is H2</h2>
5-
</hello>
6-
<router-link to="product">Product</router-link>
3+
<img src="~assets/images/logo.png">
4+
<hello name="Vue-Typescript" class="hello"></hello>
5+
<h2>Example</h2>
6+
<div class="links">
7+
<router-link to="product">css scoped</router-link>
8+
<router-link to="todo">vuex</router-link>
9+
</div>
710
</div>
811
</template>
912
<style src="./home.scss" lang="scss" scoped></style>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Filter
3+
* @author Allenice <994298628@qq.com>
4+
* @date 2017-07-21 11:33:30
5+
* @since 1.0.0
6+
*/
7+
@import "base/base";
8+
9+
.filters {
10+
text-align: center;
11+
12+
a {
13+
padding: 5px 10px;
14+
margin: 0 10px;
15+
border: 1px solid transparent;
16+
border-radius: 5px;
17+
background: none;
18+
color: #4f4f4f;
19+
cursor: pointer;
20+
}
21+
22+
/deep/ {
23+
.cur {
24+
border: 1px solid $color-primary;
25+
}
26+
}
27+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Filter
3+
* @author Allenice <994298628@qq.com>
4+
* @date 2017-07-21 11:33:30
5+
* @since 1.0.0
6+
*/
7+
8+
import Vue from 'components/base'
9+
import { Component } from 'vue-property-decorator'
10+
import template from './filter.vue'
11+
12+
@Component({
13+
name: 'view-todo-filter',
14+
mixins: [template]
15+
})
16+
export default class Filter extends Vue {
17+
18+
}

0 commit comments

Comments
 (0)