Skip to content

Commit 63d4b39

Browse files
author
huangshuwei
committed
添加示例
1 parent d0e8645 commit 63d4b39

File tree

17 files changed

+9044
-0
lines changed

17 files changed

+9044
-0
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 4
4+
trim_trailing_whitespace = true
5+
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+
libs
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?

examples/.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

examples/.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.{js,jsx,ts,tsx,vue}]
2+
indent_style = space
3+
indent_size = 2
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true

examples/.eslintrc.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// 参考 https://eslint.org/docs/user-guide/configuring
2+
module.exports = {
3+
root: true,
4+
env: {
5+
node: true
6+
},
7+
extends: ["plugin:vue/essential", "eslint:recommended"],
8+
rules: {
9+
"no-console": "off",
10+
"no-debugger": "off",
11+
"no-unused-vars": "off",
12+
"no-useless-escape": "off",
13+
// plugin:vue/recommended 规则
14+
"vue/attributes-order": "error",
15+
"vue/html-quotes": ["error", "double"],
16+
// plugin:vue/strongly-recommended 规则
17+
"vue/attribute-hyphenation": ["error", "always"],
18+
"vue/html-end-tags": "error",
19+
"vue/html-indent": "off",
20+
"vue/require-default-prop": "error",
21+
"vue/require-prop-types": "error",
22+
"vue/jsx-uses-vars": "error",
23+
"vue/order-in-components": [
24+
"error",
25+
{
26+
// methods 顺序和 官网推荐稍有不同
27+
order: [
28+
"el",
29+
"name",
30+
"parent",
31+
"functional",
32+
["delimiters", "comments"],
33+
["components", "directives", "filters"],
34+
"extends",
35+
"mixins",
36+
"inheritAttrs",
37+
"model",
38+
["props", "propsData"],
39+
"data",
40+
"computed",
41+
"watch",
42+
"methods",
43+
"LIFECYCLE_HOOKS",
44+
["template", "render"],
45+
"renderError"
46+
]
47+
}
48+
]
49+
},
50+
parserOptions: {
51+
parser: "babel-eslint"
52+
},
53+
globals: {}
54+
};

examples/.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?

examples/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# examples
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+
### Lints and fixes files
19+
```
20+
yarn lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

examples/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+
}

examples/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "examples",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"core-js": "^3.6.5",
12+
"vue": "^2.6.11",
13+
"vue-router": "^3.2.0"
14+
},
15+
"devDependencies": {
16+
"@vue/cli-plugin-babel": "~4.5.0",
17+
"@vue/cli-plugin-eslint": "~4.5.0",
18+
"@vue/cli-plugin-router": "~4.5.0",
19+
"@vue/cli-service": "~4.5.0",
20+
"@vue/eslint-config-standard": "^5.1.2",
21+
"babel-eslint": "^10.1.0",
22+
"eslint": "^6.7.2",
23+
"eslint-plugin-import": "^2.20.2",
24+
"eslint-plugin-node": "^11.1.0",
25+
"eslint-plugin-promise": "^4.2.1",
26+
"eslint-plugin-standard": "^4.0.0",
27+
"eslint-plugin-vue": "^6.2.2",
28+
"vue-template-compiler": "^2.6.11"
29+
}
30+
}

examples/public/favicon.ico

4.19 KB
Binary file not shown.

examples/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>

examples/src/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div id="app">
3+
test
4+
</div>
5+
</template>

examples/src/assets/logo.png

6.69 KB
Loading

examples/src/main.js

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

examples/src/router/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Vue from "vue";
2+
import VueRouter from "vue-router";
3+
4+
Vue.use(VueRouter);
5+
6+
const routes = [];
7+
8+
const router = new VueRouter({
9+
routes
10+
});
11+
12+
export default router;

0 commit comments

Comments
 (0)