<template>
<view class="bodyContent">
<form @submit="formSubmit" @reset="formReset" class="mytitle">
<view class="bodys">
<view class="content">
<text class="tit">账号:</text>
<input type="text" v-model="form.name" name="name" placeholder="请输入账号" class="input" />
</view>
<view class="content">
<text class="tit">密码:</text>
<input type="text" v-model="form.password" name="password" placeholder="请输入密码" class="input" />
</view>
</view>
<button form-type="submit" class="add">登录</button>
</form>
</view>
</template>
<script>
// import apiUrl from '@/utils/api.js'
export default {
data() {
return {
form:{
name:'admin',
password:'admin',
}
}
},
onLoad() { // 第一次加载他可能会默认显示 所以我们首先先 隐藏了
const subNvue = uni.getSubNVueById('popup');
// subNvue.hide();
},
methods: {
}
}
</script>
<style>
.myimg {
width: 150px;
height: 150px;
}
.content {
flex-direction: row;
margin-top: 30px;
height: 50px;
}
.tit {
font-size: 16px;
line-height: 40px;
}
.input {
width: 200rpx;
border-style: solid;
border-width: 1px;
font-size: 16px;
height: 40px;
padding-left: 10px;
border-color: #ccc
}
.bodyContent {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
justify-content: center;
align-items: center;
}
.mytitle {
justify-content: center;
align-items: center;
}
.bodys {
width: 400px;
height: 180px;
}
.add {
width: 100px;
margin-top: 10px;
}
.delout {
font-size: 15px;
right: 10px;
position: absolute;
top: 0;
}
.del{
font-size: 15px;
}
</style>
3 个回复
DCloud_UNI_Anne
先用value,已反馈给相关组,感谢您的反馈!
DCloud_UNI_Anne
password 会把初始值清空,你先初始值为空,等页面加载好再延迟一下再赋值
pure111
你好,请问该bug是否已修改