From be74b258ca3c50f753c7e9abcc17a27999ea8ab5 Mon Sep 17 00:00:00 2001 From: hejianhao <15708179461@qq.com> Date: 星期二, 01 四月 2025 18:00:24 +0800 Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory --- src/views/login/index.vue | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 4a934bc..90504d1 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,6 +1,6 @@ <template> <div class="login-page"> - <div class="login-content"> + <div class="login-content" :style="contentStyle"> <div class="login-title"> InnoLab </div> @@ -20,7 +20,7 @@ </div> <div class="login-btn"> - <el-button type="primary" class="login-btn-item" @click="login">登录</el-button> + <el-button type="primary" class="login-btn-item" @click="login">立即登录</el-button> </div> </div> @@ -32,14 +32,35 @@ name: 'Login', data() { return { + windowWidth: window.innerWidth, + loginForm: { account: '', password: '' }, - viewWidth: '' + viewWidth: '', + scale: 1 } }, - + computed: { + contentStyle() { + return { + transform: `scale(${this.scale})`, + transformOrigin: 'center center' + } + } + }, + watch: { + viewWidth(newWidth) { + if (newWidth <= 900) { // 小屏平板 + this.scale = 0.9 + } else if (newWidth <= 1200) { // 平板尺寸 + this.scale = 0.8 + } else { + this.scale = 1 + } + } + }, created() { // 初始化获取窗口宽度 this.viewWidth = window.innerWidth @@ -57,6 +78,7 @@ console.log(this.viewWidth) }, login() { + this.$router.push('/') console.log(this.loginForm) } } @@ -98,6 +120,7 @@ display: flex; flex-direction: column; align-items: center; + transition: transform 0.3s ease; .login-title { // width: 70%; @@ -123,7 +146,6 @@ width: 100%; .form-item { - width: calc(100% - 80px); height: 60px; border-radius: 30px; border: 2px solid #DBDBDB; -- Gitblit v1.7.1