使用某视频剪辑软件写一个登录页面
使用某视频剪辑软件写一个登录页面
上一博客讲到构建了一个某视频剪辑软件项目,现在在那个项目之上实现一个登录页面。
1.构建项目的目录
2.App.vue
模板
差异
路由器-视图/
/div
/模板
脚本
导出默认值{
名称: '应用'
}
/script
main.js
//使用"导入"命令加载的某视频剪辑软件构建版本
//(仅运行时或独立)已在webpack.base.conf中用别名设置。
从“vue”导入某视频剪辑软件
从""导入应用程序“/App”
从""导入路由器“/路由器”
从"元素-用户界面"导入元素用户界面
导入"元素-ui/lib/主题-粉笔/index.css "
//自己写的样式
"进口"。/style/theme.css '
"进口"。/style/characters.css '
//注册元素用户界面
Vue.use(ElementUI)
Vue.config.productionTip=false
/* ESL int-禁用无新功能*/
新Vue({ 0
el: '#app ',
路由器,
组件: { App },
模板: 'App/'
})
主题。钢性铸铁
正文{
padd : 0;
余量:0
字体系列: '微软雅黑用户界面之光;
}。outer_label {
相对位置:
左: 0;
top : 0;
宽度: 100%;
高度: 220 px
背景:-网络套件-线性-渐变(左、#000099、# 2154 fa);/* Safari 5.1 - 6.0 */
背景:-o-线性梯度(右、#000099、# 2154 fa);/*歌剧11
.1 - 12.0 */
character.css
- .text-size12px{
- font-size: 12px;
- }
- .text-size14px{
- font-size: 14px;
- }
- .text-size16px{
- font-size: 16px;
- }
- .float-right {
- float: right;
- }
- .item-color {
- color: #848487;
- }
index.js
- import Vue from 'vue'
- import Router from 'vue-router'
- // import HelloWorld from '@/components/HelloWorld'
- import Login from '@/components/login/Login'
- Vue.use(Router)
- export default new Router({
- routes: [
- {
- path: '/',
- name: 'Login',
- component: Login
- }
- ]
- })
Login.vue
- template
- div
- div class="outer_label"
- img class="inner_label login_logo" src="../../assets/logo.png"
- /div
- div class="login_form"
- input type="text" class="qxs-ic_user qxs-icon" placeholder="用户名" v-model="userName"
- input type="text" class="qxs-ic_password qxs-icon" placeholder="密码" v-model="password"
- !--button class="login_btn el-button el-button#45;#45;primary is-round" type="primary" round登录/button--
- el-button class="login_btn" @click.native="login" type="primary" round :loading="isBtnLoading"登录/el-button
- div style="margin-top: 10px"
- span style="color: #000099;" @click="login"司机账号登陆/spanspan style="float: right;color: #A9A9AB"忘记密码/span
- /div
- /div
- /div
- /template
- script
- // import { userLogin } from '../../api/api';
- export default {
- data() {
- return {
- userName: '',
- password: '',
- isBtnLoading: false
- }
- },
- created () {
- if(JSON.parse( localStorage.getItem('user')) JSON.parse( localStorage.getItem('user')).userName){
- this.userName = JSON.parse( localStorage.getItem('user')).userName;
- this.password = JSON.parse( localStorage.getItem('user')).password;
- }
- },
- computed: {
- btnText() {
- if (this.isBtnLoading) return '登录中...';
- return '登录';
- }
- },
- methods: {
- login() {
- if (!this.userName) {
- this.$message.error('请输入用户名');
- return;
- }
- if (!this.password) {
- this.$message.error('请输入密码');
- return;
- }
- }
- }
- }
- /script
- style
- .login_form {
- padding-top: 10%;
- padding-left: 10%;
- padding-right: 10%;
- }
- .qxs-ic_user {
- background: url("../../assets/login/ic_user.png") no-repeat;
- background-size: 13px 15px;
- background-position: 3%;
- }
- .qxs-ic_password {
- background: url("../../assets/login/ic_password.png") no-repeat;
- background-size: 13px 15px;
- background-position: 3%;
- margin-bottom: 20px;
- }
- .login_logo {
- height: 100%;
- }
- .login_btn {
- width: 100%;
- font-size: 16px;
- background: -webkit-linear-gradient(left, #000099, #2154FA); /* Safari 5.1 - 6.0 */
- background: -o-linear-gradient(right, #000099, #2154FA); /* Opera 11.1 - 12.0 */
- background: -moz-linear-gradient(right, #000099, #2154FA); /* Firefox 3.6 - 15 */
- background: linear-gradient(to right, #000099 , #2154FA); /* 标准的语法 */
- filter: brightness(1.4);
- }
- /style
ic_password.png
ic_user.png
logo.png
3.根据npm run dev 命令启动,启动完成之后会有个链接,访问链接就直接可以看到下面页面:
问题交流群,不定期分享各种技术文档:
QQ群号:464512055
群二维码:
这是一个神器的二维码,扫描之后你会少掉一块钱。
内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/52108.html