This commit is contained in:
asd
2021-11-01 18:58:22 +08:00
commit 494f0a1b0e
20 changed files with 9044 additions and 0 deletions

3
.browserslistrc Normal file
View File

@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

23
.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

5
babel.config.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "lesson",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"lib-flexible": "^0.3.2",
"postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "5.1.1",
"sass-loader": "9.0.0",
"vant": "^3.2.6",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
"vue-template-compiler": "^2.6.14"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"sass": "^1.43.4",
"typescript": "~4.1.5"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

17
public/index.html Normal file
View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

16
src/App.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
<div id="nav">
<router-view/>
</div>
</template>
<style>
</style>
<script>
// import "./utils/rem.js";
export default {
}
</script>

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,61 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target="_blank" rel="noopener">typescript</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
name: 'HelloWorld',
props: {
msg: String,
},
});
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

8
src/main.ts Normal file
View File

@@ -0,0 +1,8 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import 'lib-flexible/flexible'
import Vant from 'vant';
import 'vant/lib/index.css';
createApp(App).use(router).use(Vant).mount('#app')

18
src/router/index.ts Normal file
View File

@@ -0,0 +1,18 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: Array<RouteRecordRaw> = [
{
path: '/',
name: 'login',
// 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/Login.vue')
}
]
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
})
export default router

6
src/shims-vue.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
/* eslint-disable */
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}

1
src/static/img/logo.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 279.98 279.98"><g data-name="图层 2"><g data-name="图层 1"><circle cx="139.99" cy="139.99" r="139.99" fill="#ec715b"/><path d="m92.44 119.79 26.24 25.79V197s-22.13-.57-24.18-24.3c0 0-22.82-.23-24.42-24.41 0 0-23.27-1.6-24.41-24.19L48.4 112Z" fill="#fff"/><path d="M223.41 103.08 139.9 18.2l15.74 127.66-37.31 116 17.37 18c1.43.05 2.85.08 4.29.08A140 140 0 0 0 278.5 119.68l-19.73-19.4Z" fill="#e7447a"/><path fill="#36596e" d="M118.33 221.58h21.72v40.31h-21.72z"/><path fill="#03283e" d="M140.06 221.58h21.72v40.31h-21.72z"/><path fill="#c1e0f2" d="M140.06 209.35h21.72v12.24h-21.72z"/><path fill="#fff" d="M118.33 209.35h21.72v12.24h-21.72z"/><path d="m148.88 37.71-8.82-19.63-8.82 19.63Z" fill="#03283e"/><path d="M21.34 100.19h73.34s20.37-1.36 23.76 22.41v25.8S97.39 149.08 94 124H45.78s-21.05 0-24.44-23.81Z" fill="#c4e4f7"/><path d="M140.06 71.59h-21.73l12.91-33.88 8.87.07Z" fill="#fff"/><path d="M140.06 71.59h21.72l-12.9-33.88-8.82.07Z" fill="#f8eed4"/><path d="m187.75 119.79-26.24 25.79V197s22.13-.57 24.18-24.3c0 0 22.82-.23 24.42-24.41 0 0 23.27-1.6 24.41-24.19l-2.74-12.1Z" fill="#c4e4f7"/><path d="M258.85 100.19h-73.34s-20.37-1.36-23.76 22.41v25.8s21.05.68 24.44-24.44h48.22s21.05.04 24.44-23.77Z" fill="#7dc1eb"/><path fill="#205779" d="M140.06 71.59h21.72v137.76h-21.72z"/><path fill="#2d6a91" d="M118.33 71.59h21.72v137.76h-21.72z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

5
src/views/About.vue Normal file
View File

@@ -0,0 +1,5 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

18
src/views/Home.vue Normal file
View File

@@ -0,0 +1,18 @@
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js + TypeScript App"/>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /src
export default defineComponent({
name: 'Home',
components: {
HelloWorld,
},
});
</script>

49
src/views/Login.vue Normal file
View File

@@ -0,0 +1,49 @@
<template>
<div class="login">
<div class="main">
<img src="../static/img/logo.svg" alt="">
<van-field
v-model="account"
label="文本"
placeholder="请输入用户名"
class="shuru"
label-align ="center"
/>
<van-field
v-model="account"
label="文本"
placeholder="请输入密码"
:border="true"
class="shuru"
label-align ="center"
/>
</div>
</div>
</template>
<script>
import { ref } from "vue";
export default {
setup() {
let account = ref("");
return {
account,
};
},
};
</script>
<style lang="scss" scoped>
.login {
.main {
// background: red;
width:628px;
margin:0 auto;
.shuru{
height:83px;
width:628px;
border-bottom:1px solid #eeeeee;
}
}
}
</style>

39
tsconfig.json Normal file
View File

@@ -0,0 +1,39 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}

19
tslint.json Normal file
View File

@@ -0,0 +1,19 @@
{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"linterOptions": {
"exclude": [
"node_modules/**"
]
},
"rules": {
"indent": [true, "spaces", 2],
"interface-name": false,
"no-consecutive-blank-lines": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [true, "single"]
}
}

16
vue.config.js Normal file
View File

@@ -0,0 +1,16 @@
module.exports = {
lintOnSave: true,
css: {
loaderOptions: {
postcss: {
plugins: [
require('postcss-pxtorem')({//这里是配置项,详见官方文档
rootValue : 100, // 换算的基数
selectorBlackList : ['weui','mu'], // 忽略转换正则匹配项
propList : ['*'],
}),
]
}
}
},
}

8710
yarn.lock Normal file

File diff suppressed because it is too large Load Diff