TypeError: undefined is not an object (evaluating 't._wrapper')是什么意思???
在v3模式下会报这样的错误,
老版本没有此错误
代码:
<template>
<view>
<!-- 占位导航栏高度 -->
<uni-status-bar bgColor="#FFE933"></uni-status-bar>
<!-- 头部背景图 -->
<image class="user-set-login-headbg" src="../../static/common/loginbg.png" mode="widthFix"></image>
<!-- 关闭按钮 -->
<view class="iconfont icon-cross close" @tap="close"></view>
<view class="body">
<!-- 密码登录 -->
<!-- <template v-if="status"> -->
<view class="q1" v-show="status">
<input type="text" placeholder="昵称/手机号/邮箱" maxlength="18" v-model="username" class="uni-input change-input" />
<view class="login-input-box forget-input">
<input type="text" placeholder="请输入密码" maxlength="18" v-model="password" password class="uni-input change-input" />
<view class="forget u-f-ac u-f-ajc" @tap="forget">忘记密码?</view>
</view>
</view>
<!-- </template> -->
<!-- 验证码登录 -->
<!-- <template v-else> -->
<view class="q2" v-show="!status">
<view class="login-input-box ">
<view class="phone u-f-ac u-f-ajc">+86</view>
<input type="text" placeholder="输入手机号" maxlength="18" v-model="phone" class="uni-input change-input phone-input" />
</view>
<view class="login-input-box">
<input type="text" placeholder="输入验证码" maxlength="18" v-model="checknum" class="uni-input change-input auth-input" />
<view class=" u-f-ac u-f-ajc auth" @tap="ss"><view>获取验证码</view></view>
</view>
</view>
<!-- </template> -->
<!-- 协议 -->
<view class="login-rule u-f-ac u-f-ajc">
<view class="common-font-color">我已阅读并同意</view>
<view class="link-color" @tap="agreement">用户服务协议</view>
<view>和</view>
<view class="link-color" @tap="policy">隐私政策</view>
</view>
<!-- 登录 -->
<button type="default" class="common-btn" :class="{ 'home-disable-btn': disabled }" @tap="submit">登录</button>
<!-- 登录方式切换 -->
<view class="u-f-ajc u-f-ac" @tap="changeStatus">
验证码登录
<view class="iconfont icon-you- common-font-color"></view>
</view>
<!-- 第三方登录 -->
<view class="other-login-title u-f-ajc u-f-ac common-padding common-font-color">第三方账号登录</view>
<other-login></other-login>
</view>
</view>
</template>
<script>
import uniStatusBar from '../../components/uni-status-bar/uni-status-bar.vue';
import otherLogin from '../../components/home/other-login.vue';
export default {
components: {
uniStatusBar,
otherLogin
},
data() {
return {
/*true密码登录
false验证码登录*/
status: true,
// 表单值
disabled: false,
loading: false,
username: '',
password: '',
phone: '',
checknum: ''
};
},
methods: {
// 关闭按钮
close() {
uni.navigateBack({
delta: 1
});
},
// 忘记密码
forget() {
uni.navigateTo({
url: ''
});
},
// 用户协议
agreement() {},
// 隐私政策
policy() {},
// 登录方式切换
changeStatus() {
this.status = !this.status;
this.initinput();
},
// 初始化表单
initinput() {
(this.username = ''), (this.password = ''), (this.phone = ''), (this.checknum = '');
},
// 改变按钮状态
// onBtnChange() {
// if((this.username&&this.password)||(this.phone&&this.checknum)) {
// this.disabled=false
// return
// }
// this.disabled=true
// },
// 登录
submit() {
console.log(this.username);
console.log(this.password);
}
}
};
</script>
<style scoped>
/* 公共padding值 */
.common-padding {
padding: 20rpx 0;
}
.common-font-color {
color: #d5d5d5;
}
.link-color {
color: #32b1fc;
}
.user-set-login-headbg {
width: 100%;
}
/* 关闭按钮 */
.close {
position: fixed;
top: 30px;
left: 30rpx;
font-size: 46rpx;
font-weight: bold;
color: #564f11;
}
.login-input-box {
position: relative;
}
/* 忘记密码 */
.forget {
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 150rpx;
/* background-color: #007AFF; */
}
.forget-input > input {
padding-right: 150rpx;
}
/* 协议 */
.login-rule {
margin: 45rpx 0 0 0;
}
.login-rule view {
font-size: 26rpx;
}
/* 登录按钮 */
.common-btn {
margin-top: 16rpx;
}
/* 第三方账号登录 */
.other-login-title {
position: relative;
/* background-color: #0077AA; */
}
.other-login-title::after,
.other-login-title::before {
position: absolute;
top: 50%;
content: '';
width: 100rpx;
height: 1rpx;
background-color: #d5d5d5;
}
.other-login-title::before {
left: 20%;
}
.other-login-title::after {
right: 20%;
}
/* 验证码登录 */
.phone {
position: absolute;
top: 0;
left: 0;
/* background-color: #007AFF; */
width: 80rpx;
height: 100%;
}
.phone-input {
padding-left: 80rpx;
}
.auth-input {
padding-right: 160rpx;
}
.auth {
position: absolute;
top: 0;
right: 0;
/* background-color: #007AFF; */
width: 160rpx;
height: 100%;
}
.auth > view {
border-radius: 15rpx;
padding: 6rpx 20rpx;
background-color: #f4f4f4;
font-size: 22rpx;
}
</style>
0 个回复