请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

login page 粘贴过来样式显示不对

https://img1.sycdn.imooc.com//szimg/5b4ea7820001b6c710330667.jpg

login page 的样式显示如图,代码是直接粘贴过来的应该没啥问题吧?

代码如下: login.vue

<template>

<form class="login-form" @submit="doSubmit">

<h1>

<span>Login</span>

<span class="error-msg" v-show="errorMsg">{{errorMsg}}</span>

</h1>

<input

type="text"

class="login-input"

placeholder="User Name"

v-model="username"

>

<input

type="password"

class="login-input"

placeholder="Password"

autocomplete="new-password"

v-model="password"

>

<button type="submit" class="login-btn">登 录</button>

</form>

</template>


<script>

export default {

metaInfo: {

title: 'Login Page'

},

data () {

return {

username: '',

password: '',

errorMsg: ''

}

},

methods: {

doSubmit (e) {

e.preventDefault()

if (this.validate()) {

// api

}

},

validate () {

if (!this.username.trim()) {

this.errorMsg = 'User name should not be null.'

return false

}

if (!this.password.trim()) {

this.errorMsg = 'Password should not be null.'

return false

}

this.errorMsg = ''

return true

}

}

}

</script>


<style lang="stylus" scoped>

.login-form

display flex

flex-direction column

align-items flex-start

width 350px

margin 0 auto

padding 20px

background-color #fff

h1

font-weight 100

color #3d3d3d

.login-input

appearance none

padding 0 10px

line-height 30px

margin-bottom 20px

border 1px solid #aaa

width 100%

border-radius 0

box-shadow 0 0 0

.login-btn

appearance none

width 100%

line-height 30px

text-align center

background-color #0d60c7

color #eaeaea

cursor pointer

border-color #0d60c7

transition all .3s

&:hover

color #fff

background-color darken(#0d60c7, 10)

.error-msg

font-size 12px

color red


@media screen and (max-width: 600px) {

.login-form {

width 90%

}

.login-input{

line-height 40px

}

}

</style>


麻烦老师帮忙看下,这个input的右边界貌似之前也出现过这样的问题,搞不太懂

正在回答

2回答

样式不对改一下不就完了。。。

0 回复 有任何疑惑可以回复我~
  • 提问者 Marianax #1
    老板我不会改。。TT,我是觉得代码没啥问题。。不知道为啥会出现这样的样式问题
    回复 有任何疑惑可以回复我~ 2018-07-19 19:00:38
  • 提问者 Marianax #2
    我用下载的工程直接运行过了没什么问题,login.vue直接拷贝过来,样式还是不对,不知道有什么login.vue之外的有什么可以影响它样式的因素吗?
    回复 有任何疑惑可以回复我~ 2018-07-20 11:10:51
  • 提问者 Marianax #3
    app.vue, footer.vue, header.vue, 样式都查过了,还是有这样的问题,不知道跟配置或者什么插件的版本有没有关系?
    回复 有任何疑惑可以回复我~ 2018-07-20 11:17:15
旋涡鸣人_ 2018-11-11 13:40:10

.login-input

box-sizing border-box


加一句就好了。。。


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信