Merge pull request !13 from 覃杰/auto-8533815-develop-1628562904646
This commit is contained in:
覃杰 2021-08-10 02:35:19 +00:00 committed by Gitee
commit fb22a9c876
8 changed files with 96 additions and 75 deletions

View File

@ -12,6 +12,7 @@
"element-ui": "^2.15.5", "element-ui": "^2.15.5",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vue-wechat-title": "^2.0.7",
"vuex": "^3.4.0" "vuex": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,17 +1,25 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="./favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title></title>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head> </head>
<body> <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> <div id="app"></div>
<!-- built files will be auto injected -->
</body> </body>
</html>
</html>

View File

@ -1,41 +1,17 @@
<template> <template>
<div id="app"> <div id="app">
<el-button type="success">成功</el-button> <!-- 使用vue-wechat-title动态修改title -->
<el-button type="success">成功按钮111</el-button> <router-view v-wechat-title="$route.meta.title" />
<hello-world></hello-world>
</div> </div>
</template> </template>
<script> <style scoped>
import HelloWorld from "@/components/HelloWorld.vue";
export default {
name: "Home",
components: {
HelloWorld,
}
};
</script>
<style>
#app { #app {
font-family: Avenir, Helvetica, Arial, sans-serif; width: 100%;
-webkit-font-smoothing: antialiased; height: 100%;
-moz-osx-font-smoothing: grayscale; margin: 0;
text-align: center; padding: 0;
color: #2c3e50; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
} }
</style>
#nav {
padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
}
</style>

View File

@ -4,9 +4,12 @@ import router from './router'
import store from './store' import store from './store'
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import VueWechatTitle from 'vue-wechat-title';
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.use(VueWechatTitle);
// 阻止启动生产消息
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({

View File

@ -1,22 +1,14 @@
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
{ {
path: '/', path: '/',
name: 'Home', name: 'Login',
component: Home component: () => import('../views/login/index.vue'),
}, meta: { title: '安全培训 - 登陆' }
{
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')
} }
] ]

View File

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

View File

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

64
src/views/login/index.vue Normal file
View File

@ -0,0 +1,64 @@
<template>
<div class="login_main">
<div class="login">
<div class="login_title">安全培训系统登录</div>
<div class="login_form">
<el-input placeholder="用户名" v-model="input1">
<template slot="prepend">Http://</template>
</el-input>
<el-input placeholder="密码" v-model="input1">
<template slot="prepend">Http://</template>
</el-input>
<el-link
href="javascript:void(0)"
:underline="false"
icon="el-icon-edit"
>忘记密码</el-link
>
<el-button type="primary"> </el-button>
</div>
</div>
</div>
</template>
<style scoped>
.login_main {
width: 100%;
height: 100%;
background-color: #f2f6fc;
position: absolute;
}
.login {
width: 500px;
height: auto;
margin: 100px auto;
border-radius: 4px;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.login_title {
width: 100%;
height: 60px;
font-size: 24px;
font-weight: bold;
text-align: center;
line-height: 60px;
}
/* border-bottom: 1px solid #ccc; */
.login_form {
width: 90%;
margin: 0 auto;
}
.el-input {
margin-top: 20px;
}
.el-link {
margin-top: 20px;
float: right;
}
.el-button {
width: 100%;
margin-top: 20px;
margin-bottom: 20px;
}
</style>