feat: add @vben/hooks and @vben-core/constants

This commit is contained in:
vben
2024-07-13 16:52:08 +08:00
parent daa31f7156
commit 5e0b01c725
34 changed files with 161 additions and 44 deletions

View File

@@ -0,0 +1,3 @@
# \_core
此目录包含应用程序正常运行所需的基本视图。这些视图是应用程序布局中使用的视图。

View File

@@ -0,0 +1,25 @@
<script lang="ts" setup>
import type { LoginCodeParams } from '@vben/universal-ui';
import { ref } from 'vue';
import { AuthenticationCodeLogin } from '@vben/universal-ui';
defineOptions({ name: 'CodeLogin' });
const loading = ref(false);
/**
* 异步处理登录操作
* Asynchronously handle the login process
* @param values 登录表单数据
*/
async function handleLogin(values: LoginCodeParams) {
// eslint-disable-next-line no-console
console.log(values);
}
</script>
<template>
<AuthenticationCodeLogin :loading="loading" @submit="handleLogin" />
</template>

View File

@@ -0,0 +1,18 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { AuthenticationForgetPassword } from '@vben/universal-ui';
defineOptions({ name: 'ForgetPassword' });
const loading = ref(false);
function handleSubmit(value: string) {
// eslint-disable-next-line no-console
console.log('reset email:', value);
}
</script>
<template>
<AuthenticationForgetPassword :loading="loading" @submit="handleSubmit" />
</template>

View File

@@ -0,0 +1,18 @@
<script lang="ts" setup>
import { AuthenticationLogin } from '@vben/universal-ui';
import { useAccessStore } from '#/store';
defineOptions({ name: 'Login' });
const accessStore = useAccessStore();
</script>
<template>
<AuthenticationLogin
:loading="accessStore.loading"
password-placeholder="123456"
username-placeholder="vben"
@submit="accessStore.authLogin"
/>
</template>

View File

@@ -0,0 +1,9 @@
<script lang="ts" setup>
import { AuthenticationQrCodeLogin } from '@vben/universal-ui';
defineOptions({ name: 'QrCodeLogin' });
</script>
<template>
<AuthenticationQrCodeLogin />
</template>

View File

@@ -0,0 +1,20 @@
<script lang="ts" setup>
import type { LoginAndRegisterParams } from '@vben/universal-ui';
import { ref } from 'vue';
import { AuthenticationRegister } from '@vben/universal-ui';
defineOptions({ name: 'Register' });
const loading = ref(false);
function handleSubmit(value: LoginAndRegisterParams) {
// eslint-disable-next-line no-console
console.log('register submit:', value);
}
</script>
<template>
<AuthenticationRegister :loading="loading" @submit="handleSubmit" />
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
</script>
<template>
<Fallback status="comming-soon" />
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
</script>
<template>
<Fallback status="403" />
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
</script>
<template>
<Fallback status="500" />
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
</script>
<template>
<Fallback status="404" />
</template>

View File

@@ -0,0 +1,7 @@
<script lang="ts" setup>
import { Fallback } from '@vben/universal-ui';
</script>
<template>
<Fallback status="offline" />
</template>

View File

@@ -0,0 +1,9 @@
<script lang="ts" setup>
import { About } from '@vben/universal-ui';
defineOptions({ name: 'About' });
</script>
<template>
<About />
</template>