🐞 fix: css格式scss修改为less
This commit is contained in:
parent
74ceb12353
commit
e0ea35c789
|
@ -11,4 +11,4 @@
|
||||||
|
|
||||||
<script setup></script>
|
<script setup></script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
|
|
@ -48,9 +48,9 @@ import { reactive } from "vue";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
|
|
||||||
const INITIAL_DATA = {
|
const INITIAL_DATA = {
|
||||||
account: '',
|
account: "",
|
||||||
password: '',
|
password: "",
|
||||||
rePassword: '',
|
rePassword: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
@ -61,8 +61,8 @@ const rules = reactive({
|
||||||
account: [
|
account: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '学号必填',
|
message: "学号必填",
|
||||||
type: 'error',
|
type: "error",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: 10,
|
min: 10,
|
||||||
|
@ -76,8 +76,8 @@ const rules = reactive({
|
||||||
password: [
|
password: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '密码必填',
|
message: "密码必填",
|
||||||
type: 'error',
|
type: "error",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
len: 8,
|
len: 8,
|
||||||
|
@ -91,8 +91,8 @@ const rules = reactive({
|
||||||
rePassword: [
|
rePassword: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '密码必填',
|
message: "密码必填",
|
||||||
type: 'error',
|
type: "error",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
len: 8,
|
len: 8,
|
||||||
|
@ -106,74 +106,75 @@ const rules = reactive({
|
||||||
});
|
});
|
||||||
|
|
||||||
const onReset = () => {
|
const onReset = () => {
|
||||||
MessagePlugin.success('重置成功');
|
MessagePlugin.success("重置成功");
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = ({ validateResult, firstError }) => {
|
const onSubmit = ({ validateResult, firstError }) => {
|
||||||
if (validateResult === true) {
|
if (validateResult === true) {
|
||||||
MessagePlugin.success('提交成功');
|
MessagePlugin.success("提交成功");
|
||||||
} else {
|
} else {
|
||||||
console.log('Errors: ', validateResult);
|
console.log("Errors: ", validateResult);
|
||||||
MessagePlugin.warning(firstError);
|
MessagePlugin.warning(firstError);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onValidate = ({ validateResult, firstError }) => {
|
const onValidate = ({ validateResult, firstError }) => {
|
||||||
if (validateResult === true) {
|
if (validateResult === true) {
|
||||||
console.log('Validate Success');
|
console.log("Validate Success");
|
||||||
} else {
|
} else {
|
||||||
console.log('Validate Errors: ', firstError, validateResult);
|
console.log("Validate Errors: ", firstError, validateResult);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 自定义异步校验器,使用 resolve 返回结果控制校验结果、校验信息、校验结果类型
|
// 自定义异步校验器,使用 resolve 返回结果控制校验结果、校验信息、校验结果类型
|
||||||
const userNameValidator = (val) => new Promise((resolve) => {
|
const userNameValidator = (val) =>
|
||||||
const timer = setTimeout(() => {
|
new Promise((resolve) => {
|
||||||
if (['Zhang', 'Li', 'Wang'].includes(val)) {
|
const timer = setTimeout(() => {
|
||||||
resolve({
|
if (["Zhang", "Li", "Wang"].includes(val)) {
|
||||||
result: true,
|
resolve({
|
||||||
});
|
result: true,
|
||||||
} else {
|
});
|
||||||
resolve({
|
} else {
|
||||||
result: false,
|
resolve({
|
||||||
message: '用户名不存在',
|
result: false,
|
||||||
type: 'error',
|
message: "用户名不存在",
|
||||||
});
|
type: "error",
|
||||||
}
|
});
|
||||||
clearTimeout(timer);
|
}
|
||||||
}, 10);
|
clearTimeout(timer);
|
||||||
});
|
}, 10);
|
||||||
|
});
|
||||||
// 自定义校验器,不同的值输出不同的校验结果。支持异步校验(文案选自某密码重置站点,如有侵权,请联系我们删除)
|
// 自定义校验器,不同的值输出不同的校验结果。支持异步校验(文案选自某密码重置站点,如有侵权,请联系我们删除)
|
||||||
const passwordValidator = (val) => {
|
const passwordValidator = (val) => {
|
||||||
if (val.length > 0 && val.length <= 2) {
|
if (val.length > 0 && val.length <= 2) {
|
||||||
return {
|
return {
|
||||||
result: false,
|
result: false,
|
||||||
message: '太简单了!再开动一下你的小脑筋吧!',
|
message: "太简单了!再开动一下你的小脑筋吧!",
|
||||||
type: 'error',
|
type: "error",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (val.length > 2 && val.length < 4) {
|
if (val.length > 2 && val.length < 4) {
|
||||||
return {
|
return {
|
||||||
result: false,
|
result: false,
|
||||||
message: '还差一点点,就是一个完美的密码了!',
|
message: "还差一点点,就是一个完美的密码了!",
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
result: true,
|
result: true,
|
||||||
message: '太强了,你确定自己记得住吗!',
|
message: "太强了,你确定自己记得住吗!",
|
||||||
type: 'success',
|
type: "success",
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// 自定义异步校验器
|
// 自定义异步校验器
|
||||||
const rePassword = (val) => new Promise((resolve) => {
|
const rePassword = (val) =>
|
||||||
const timer = setTimeout(() => {
|
new Promise((resolve) => {
|
||||||
resolve(formData.password === val);
|
const timer = setTimeout(() => {
|
||||||
clearTimeout(timer);
|
resolve(formData.password === val);
|
||||||
|
clearTimeout(timer);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="less" scoped>
|
||||||
.password-container {
|
.password-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -193,4 +194,4 @@ const rePassword = (val) => new Promise((resolve) => {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -43,5 +43,4 @@ import { MessagePlugin } from "tdesign-vue-next";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="less" scoped></style>
|
||||||
</style>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user