Browse Source

feat: 表单验证

test2
xuesinan 4 years ago
parent
commit
8f3bc1ea25
  1. 4
      CHANGELOG.md
  2. 8
      pages/user/accountLogin.vue

4
CHANGELOG.md

@ -15,6 +15,8 @@
- | 账户名密码登录 | [ebf456e](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/ebf456e)
- | app.vue | [970cf9a](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/970cf9a)
- | first commit | [8dc26de](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/8dc26de)
project | 日常任务面板添加 | [b3f16ff](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b3f16ff)
theme | theme demo | [9175758](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9175758)
- | vue3 | [12ed2ad](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12ed2ad)
@ -29,6 +31,8 @@
范围|描述|commitId
--|--|--
- | 修复一些内容 | [3cdb1ce](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/3cdb1ce)
app.vue | 修复获取token报错的问题 | [9120d54](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9120d54)
createTask | 修复createTask v-model的问题 | [b20d3f0](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/b20d3f0)
### 🔨 代码重构

8
pages/user/accountLogin.vue

@ -1,6 +1,6 @@
<template>
<view class="u-p-l-50 u-p-r-50 u-p-t-30">
<u-form :model="model" ref="uForm" :rules="mixinInit.rules" :error-type="mixinInit.errorType">
<u-form :model="model" ref="loginForm" :rules="mixinInit.rules" :error-type="mixinInit.errorType">
<u-form-item :label-position="mixinInit.labelPosition" label="用户名" prop="account" label-width="150">
<u-input :border="mixinInit.border" placeholder="请输入用户名" v-model="model.account" type="text"></u-input>
</u-form-item>
@ -41,7 +41,7 @@
const mixinInit = userMixin();
const userInfo = uni.$storage.getStorageSync('user');
const user = ref({});
// const uForm = ref(null);
const loginForm = ref(null);
const model = ref({
account: '',
password: ''
@ -53,7 +53,9 @@
}
const submit = () => {
// uForm.value.validate().then().catch();
loginForm.value.validate(data => {
console.log(data);
});
}
async function login() {

Loading…
Cancel
Save