Skip to content

Commit 32e66a0

Browse files
committed
init
0 parents  commit 32e66a0

17 files changed

+13047
-0
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true
5+
},
6+
'extends': [
7+
'plugin:vue/essential',
8+
'@vue/prettier'
9+
],
10+
rules: {
11+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
12+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13+
},
14+
parserOptions: {
15+
parser: 'babel-eslint'
16+
}
17+
}

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env.local
7+
.env.*.local
8+
9+
# Log files
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
14+
# Editor directories and files
15+
.idea
16+
.vscode
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw*

.postcssrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: {
3+
autoprefixer: {}
4+
}
5+
}

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@vue/app"]
3+
};

package-lock.json

+12,805
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "real-world-vue",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"vue": "^2.5.16",
12+
"vue-router": "^3.0.1",
13+
"vuex": "^3.0.1"
14+
},
15+
"devDependencies": {
16+
"@vue/cli-plugin-babel": "^3.0.0-rc.5",
17+
"@vue/cli-plugin-eslint": "^3.0.0-rc.5",
18+
"@vue/cli-service": "^3.0.0-rc.5",
19+
"@vue/eslint-config-prettier": "^3.0.0-rc.5",
20+
"vue-template-compiler": "^2.5.16"
21+
}
22+
}

public/favicon.ico

1.12 KB
Binary file not shown.

public/index.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title>real-world-vue</title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but real-world-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

src/App.vue

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<template>
2+
<div id="app">
3+
<div id="nav">
4+
<router-link to="/">Home</router-link> |
5+
<router-link to="/about">About</router-link>
6+
</div>
7+
<router-view/>
8+
</div>
9+
</template>
10+
11+
<style>
12+
#app {
13+
font-family: "Avenir", Helvetica, Arial, sans-serif;
14+
-webkit-font-smoothing: antialiased;
15+
-moz-osx-font-smoothing: grayscale;
16+
text-align: center;
17+
color: #2c3e50;
18+
}
19+
#nav {
20+
padding: 30px;
21+
}
22+
23+
#nav a {
24+
font-weight: bold;
25+
color: #2c3e50;
26+
}
27+
28+
#nav a.router-link-exact-active {
29+
color: #42b983;
30+
}
31+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/HelloWorld.vue

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
For guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://cli.vuejs.org" target="_blank">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank">babel</a></li>
12+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank">eslint</a></li>
13+
</ul>
14+
<h3>Essential Links</h3>
15+
<ul>
16+
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li>
17+
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
18+
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
19+
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
20+
</ul>
21+
<h3>Ecosystem</h3>
22+
<ul>
23+
<li><a href="https://router.vuejs.org" target="_blank">vue-router</a></li>
24+
<li><a href="https://vuex.vuejs.org" target="_blank">vuex</a></li>
25+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank">vue-devtools</a></li>
26+
<li><a href="https://vue-loader.vuejs.org" target="_blank">vue-loader</a></li>
27+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
28+
</ul>
29+
</div>
30+
</template>
31+
32+
<script>
33+
export default {
34+
name: "HelloWorld",
35+
props: {
36+
msg: String
37+
}
38+
};
39+
</script>
40+
41+
<!-- Add "scoped" attribute to limit CSS to this component only -->
42+
<style scoped>
43+
h3 {
44+
margin: 40px 0 0;
45+
}
46+
ul {
47+
list-style-type: none;
48+
padding: 0;
49+
}
50+
li {
51+
display: inline-block;
52+
margin: 0 10px;
53+
}
54+
a {
55+
color: #42b983;
56+
}
57+
</style>

src/main.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from "vue";
2+
import App from "./App.vue";
3+
import router from "./router";
4+
import store from "./store";
5+
6+
Vue.config.productionTip = false;
7+
8+
new Vue({
9+
router,
10+
store,
11+
render: h => h(App)
12+
}).$mount("#app");

src/router.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Vue from "vue";
2+
import Router from "vue-router";
3+
import Home from "./views/Home.vue";
4+
import About from "./views/About.vue";
5+
6+
Vue.use(Router);
7+
8+
export default new Router({
9+
routes: [
10+
{
11+
path: "/",
12+
name: "home",
13+
component: Home
14+
},
15+
{
16+
path: "/about",
17+
name: "about",
18+
component: About
19+
}
20+
]
21+
});

src/store.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Vue from "vue";
2+
import Vuex from "vuex";
3+
4+
Vue.use(Vuex);
5+
6+
export default new Vuex.Store({
7+
state: {},
8+
mutations: {},
9+
actions: {}
10+
});

src/views/About.vue

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="about">
3+
<h1>This is an about page</h1>
4+
</div>
5+
</template>

src/views/Home.vue

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="home">
3+
<img src="../assets/logo.png">
4+
<HelloWorld msg="Welcome to Your Vue.js App"/>
5+
</div>
6+
</template>
7+
8+
<script>
9+
// @ is an alias to /src
10+
import HelloWorld from "@/components/HelloWorld.vue";
11+
12+
export default {
13+
name: "home",
14+
components: {
15+
HelloWorld
16+
}
17+
};
18+
</script>

0 commit comments

Comments
 (0)