-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
唐道勇
authored and
唐道勇
committed
Oct 28, 2021
1 parent
a721310
commit 8d78e8c
Showing
9 changed files
with
221 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
/* | ||
* @Author: your name | ||
* @Date: 2021-10-18 17:15:20 | ||
* @LastEditTime: 2021-10-19 17:43:11 | ||
* @LastEditTime: 2021-10-28 11:37:10 | ||
* @LastEditors: Please set LastEditors | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/.eslintrc.js | ||
*/ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
es6: true, // 启用 ES6 语法支持以及新的 ES6 全局变量或类型 | ||
node: true, // Node.js 全局变量和 Node.js 作用域 | ||
browser: true, // 浏览器全局变量 | ||
}, | ||
plugins: ['prettier'], | ||
extends: [ | ||
// 一个配置文件可以从基础配置中继承已启用的规则 | ||
'plugin:vue/vue3-essential', | ||
'eslint:recommended', | ||
'@vue/typescript/recommended', | ||
'@vue/prettier', | ||
'@vue/prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
], | ||
parserOptions: { | ||
// 语法解析器的一些配置 | ||
ecmaVersion: 2020, | ||
}, | ||
rules: { | ||
// 规则 | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
// prettier样式规则,需要和配置文件的统一 | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
trailingComma: 'es5', | ||
tabWidth: 4, | ||
useTabs: true, | ||
semi: false, | ||
singleQuote: true, | ||
endOfLine: 'auto', | ||
printWidth: 100, | ||
bracketSpacing: true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }" | ||
}, | ||
], | ||
'array-bracket-newline': 'warn', | ||
}, | ||
overrides: [ | ||
// { | ||
// files: ['*.{j,t}s?(x)', '*.json?(x)', '**/.vscode/*.json?(x)'], | ||
// env: { | ||
// es6: true, | ||
// node: true, | ||
// browser: true, | ||
// }, | ||
// }, | ||
{ | ||
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], | ||
env: { | ||
jest: true, | ||
}, | ||
}, | ||
], | ||
root: true, | ||
env: { | ||
es6: true, // 启用 ES6 语法支持以及新的 ES6 全局变量或类型 | ||
node: true, // Node.js 全局变量和 Node.js 作用域 | ||
browser: true, // 浏览器全局变量 | ||
}, | ||
plugins: ['prettier'], | ||
extends: [ | ||
// 一个配置文件可以从基础配置中继承已启用的规则 | ||
'plugin:vue/vue3-essential', | ||
'eslint:recommended', | ||
'@vue/typescript/recommended', | ||
'@vue/prettier', | ||
'@vue/prettier/@typescript-eslint', | ||
'plugin:prettier/recommended', | ||
], | ||
parserOptions: { | ||
// 语法解析器的一些配置 | ||
ecmaVersion: 2020, | ||
}, | ||
rules: { | ||
// 规则 | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
// prettier样式规则,需要和配置文件的统一 | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
trailingComma: 'es5', | ||
tabWidth: 4, | ||
useTabs: false, | ||
semi: false, | ||
singleQuote: true, | ||
endOfLine: 'auto', | ||
printWidth: 100, | ||
bracketSpacing: true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }" | ||
}, | ||
], | ||
'array-bracket-newline': 'warn', | ||
}, | ||
overrides: [ | ||
// { | ||
// files: ['*.{j,t}s?(x)', '*.json?(x)', '**/.vscode/*.json?(x)'], | ||
// env: { | ||
// es6: true, | ||
// node: true, | ||
// browser: true, | ||
// }, | ||
// }, | ||
{ | ||
files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'], | ||
env: { | ||
jest: true, | ||
}, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,72 @@ | ||
<!-- | ||
* @Author: your name | ||
* @Date: 2021-10-15 15:54:50 | ||
* @LastEditTime: 2021-10-20 10:35:51 | ||
* @LastEditTime: 2021-10-28 11:37:46 | ||
* @LastEditors: Please set LastEditors | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/src/App.vue | ||
--> | ||
<template> | ||
<div id="nav"> | ||
<router-link to="/home">Home</router-link> | ||
<router-link to="/">About</router-link> | ||
</div> | ||
<div>{{ title ?? 'title' + obj?.name }}</div> | ||
<!-- 路由出口 --> | ||
<router-view></router-view> | ||
<div id="nav"> | ||
<router-link to="/home">Home</router-link> | ||
<router-link to="/">About</router-link> | ||
</div> | ||
<div>{{ title ?? 'title' + obj?.name }}</div> | ||
<!-- 路由出口 --> | ||
<router-view></router-view> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { defineComponent } from 'vue' | ||
|
||
interface Obj { | ||
name?: string | ||
age?: number | ||
name?: string | ||
age?: number | ||
} | ||
|
||
interface App { | ||
title?: string | ||
title?: string | ||
|
||
obj: Obj | ||
obj: Obj | ||
} | ||
|
||
export default defineComponent({ | ||
data() { | ||
return { | ||
title: undefined, | ||
obj: { | ||
name: 'matias', | ||
age: undefined, | ||
}, | ||
} as App | ||
}, | ||
data() { | ||
return { | ||
title: undefined, | ||
obj: { | ||
name: 'matiastang', | ||
age: undefined, | ||
}, | ||
} as App | ||
}, | ||
setup() { | ||
return { | ||
phone: '18380449615', | ||
} | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss"> | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
} | ||
|
||
#nav { | ||
padding: 30px; | ||
padding: 30px; | ||
|
||
a { | ||
font-weight: bold; | ||
color: #2c3e50; | ||
a { | ||
font-weight: bold; | ||
color: #2c3e50; | ||
|
||
&.router-link-exact-active { | ||
color: #42b983; | ||
} | ||
} | ||
&.router-link-exact-active { | ||
color: #42b983; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
/* | ||
* @Author: your name | ||
* @Date: 2021-10-18 11:27:55 | ||
* @LastEditTime: 2021-10-19 16:57:05 | ||
* @LastEditors: your name | ||
* @LastEditTime: 2021-10-28 14:08:30 | ||
* @LastEditors: Please set LastEditors | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/src/router/index.ts | ||
*/ | ||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' | ||
import Home from '../views/Home.vue' | ||
|
||
const routes: Array<RouteRecordRaw> = [ | ||
{ | ||
path: '/', | ||
name: 'Home', | ||
component: Home, | ||
}, | ||
{ | ||
path: '/about', | ||
name: 'About', | ||
// route level code-splitting | ||
// this generates a separate chunk (about.[hash].js) for this route | ||
// which is lazy-loaded when the route is visited. | ||
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'), | ||
}, | ||
{ | ||
path: '/', | ||
name: 'Home', | ||
component: Home, | ||
}, | ||
{ | ||
path: '/about', | ||
name: 'About', | ||
// route level code-splitting | ||
// this generates a separate chunk (about.[hash].js) for this route | ||
// which is lazy-loaded when the route is visited. | ||
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'), | ||
}, | ||
] | ||
|
||
const router = createRouter({ | ||
history: createWebHashHistory(), | ||
routes, | ||
history: createWebHashHistory(), | ||
routes, | ||
}) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* | ||
* @Author: your name | ||
* @Date: 2021-10-18 11:27:59 | ||
* @LastEditTime: 2021-10-18 13:52:31 | ||
* @LastEditors: your name | ||
* @LastEditTime: 2021-10-28 14:08:13 | ||
* @LastEditors: Please set LastEditors | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/src/store/index.ts | ||
*/ | ||
import Vuex from 'vuex' | ||
|
||
export default new Vuex.Store({ | ||
state: {}, | ||
mutations: {}, | ||
actions: {}, | ||
modules: {}, | ||
state: {}, | ||
mutations: {}, | ||
actions: {}, | ||
modules: {}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
<!-- | ||
* @Author: your name | ||
* @Date: 2021-10-15 17:25:57 | ||
* @LastEditTime: 2021-10-28 13:36:45 | ||
* @LastEditors: your name | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/src/views/About.vue | ||
--> | ||
<template> | ||
<div class="about"> | ||
<h1>This is an about page</h1> | ||
</div> | ||
<div class="about"> | ||
<h1>This is an about page</h1> | ||
</div> | ||
</template> |
Oops, something went wrong.