Merge pull request #26 from haichao0817/main

style: change 'loging' to 'loading'
This commit is contained in:
Ronnie Zhang 2022-09-07 14:56:17 +08:00 committed by GitHub
commit 5b2d1c68dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@
</div> </div>
<div mt-20> <div mt-20>
<n-button w-full h-50 rounded-5 text-16 type="primary" :loading="loging" @click="handleLogin"> <n-button w-full h-50 rounded-5 text-16 type="primary" :loading="loading" @click="handleLogin">
登录 登录
</n-button> </n-button>
</div> </div>
@ -73,7 +73,7 @@ function initLoginInfo() {
} }
const isRemember = useStorage('isRemember', false) const isRemember = useStorage('isRemember', false)
const loging = ref(false) const loading = ref(false)
async function handleLogin() { async function handleLogin() {
const { name, password } = loginInfo.value const { name, password } = loginInfo.value
if (!name || !password) { if (!name || !password) {
@ -81,7 +81,7 @@ async function handleLogin() {
return return
} }
try { try {
loging.value = true loading.value = true
$message.loading('正在验证...') $message.loading('正在验证...')
const res = await api.login({ name, password: password.toString() }) const res = await api.login({ name, password: password.toString() })
$message.success('登录成功') $message.success('登录成功')
@ -102,6 +102,6 @@ async function handleLogin() {
console.error(error) console.error(error)
$message.removeMessage() $message.removeMessage()
} }
loging.value = false loading.value = false
} }
</script> </script>