Skip to content

Commit b1d2cf6

Browse files
committed
added vue-cli + components
0 parents  commit b1d2cf6

23 files changed

+9189
-0
lines changed

.browserslistrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not dead

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.gitignore

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

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# tocode-youtube-vtwitter-vue-cli
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn build
16+
```
17+
18+
### Customize configuration
19+
See [Configuration Reference](https://cli.vuejs.org/config/).

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "tocode-youtube-vtwitter-vue-cli",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build"
8+
},
9+
"dependencies": {
10+
"core-js": "^3.6.5",
11+
"vue": "^3.0.0"
12+
},
13+
"devDependencies": {
14+
"@vue/cli-plugin-babel": "~4.5.0",
15+
"@vue/cli-service": "~4.5.0",
16+
"@vue/compiler-sfc": "^3.0.0",
17+
"node-sass": "^4.12.0",
18+
"sass-loader": "^8.0.2"
19+
}
20+
}

prettier.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
semi: false,
3+
singleQuote: true,
4+
arrowParens: 'avoid',
5+
trailingComma: 'none',
6+
endOfLine: 'auto',
7+
htmlFormatWrapAttributes: 'force-aligned'
8+
9+
// spaceBeforeFunctionParen: true
10+
}

public/favicon.ico

4.19 KB
Binary file not shown.

public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="">
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><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> 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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<div class="wrapper">
3+
<!-- header -->
4+
<div class="wrapper-content">
5+
<div class="view">
6+
<div class="container">
7+
<Form @onSubmit="handleSubmit" />
8+
<List :items="items" />
9+
</div>
10+
</div>
11+
</div>
12+
<!-- footer -->
13+
</div>
14+
</template>
15+
16+
<script>
17+
import Form from '@/components/Form'
18+
import List from '@/components/List'
19+
export default {
20+
components: { Form, List },
21+
data() {
22+
return {
23+
items: [
24+
{
25+
id: 1,
26+
body: 'hello vue 3',
27+
likes: 12,
28+
avatar: `https://avatars.dicebear.com/api/male/1.svg`,
29+
date: new Date(Date.now()).toLocaleString()
30+
},
31+
{
32+
id: 2,
33+
body: 'hello world',
34+
likes: 6,
35+
avatar: `https://avatars.dicebear.com/api/male/2.svg`,
36+
date: new Date(Date.now()).toLocaleString()
37+
}
38+
]
39+
}
40+
},
41+
methods: {
42+
handleSubmit(item) {
43+
this.items.push(item)
44+
}
45+
}
46+
}
47+
</script>

0 commit comments

Comments
 (0)