怪谈诡异录(一):vue前端全局页面不能缩放,局部可以

一、问题描述

网页在缩放时,整个网页没有在缩放,但是登录框却在缩放。

一开始我们可以看到网页缩放为100%

接着网页缩放值为80%,竟然只有登录框在缩放

二、代码展示

App.vue里的css代码

login/index.vue的css代码

<template>
    <div class="login">
        <div class="login-box">
            <img src="@/assets/login/login-l.png" alt="" />
            <div class="login-form">
                <el-form>
                    <div class="login-form-title">
                        <img src="@/assets/login/icon_logo.png" alt="" />
                        <!-- <span class="title-label">苍穹外卖</span> -->
                    </div>
                    <el-form-item>
                        <el-input type="text" auto-complete="off" placeholder="账号" />
                    </el-form-item>
                    <el-form-item>
                        <el-input type="password" placeholder="密码" />
                    </el-form-item>
                    <el-form-item>
                        <el-button class="login-btn" size="medium" type="primary">
                            <span v-if="!loading">登录</span>
                            <span v-else>登录中...</span>
                        </el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>


<script lang="ts">

</script>

<style lang="scss" scoped>
.login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background-color: #333;
}

.login-box {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.login-box img {
    width: 70%;
    height: 100%;
}

.login-form {
    background: #dabfbf;
    width: 600px;
    height: 400px;
    border-radius: 0px 8px 8px 0px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-form .el-form {
    width: 200px;
    height: 100px;
}

.login-form .el-form-item {
    margin-bottom: 30px;
}

.login-form .el-input__inner {
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid #e9e9e8;
    border-radius: 0;
    font-size: 12px;
    font-weight: 400;
    color: #333333;
    height: 32px;
    line-height: 32px;
}

.login-form .el-input__inner::placeholder {
    color: #aeb5c4;
}

.login-btn {
    border-radius: 17px;
    padding: 11px 20px !important;
    margin-top: 10px;
    font-weight: 500;
    font-size: 12px;
    border: 0;
    color: #333333;
    background-color: #ffc200;
}

.login-btn:hover,
.login-btn:focus {
    background-color: #ffc200;
    color: #ffffff;
}

.login-form-title {
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}
</style>

三、解决方式

暂无解决方法

四、源代码

源代码地址:https://gitee.com/zyGitee983/black-horse---sky-delivery.git

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值