123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <script setup lang="ts">
- import { reactive, ref } from 'vue'
- import { Form } from '@/components/Form'
- import { useI18n } from '@/hooks/web/useI18n'
- import { ElButton, ElCheckbox, ElLink } from 'element-plus'
- import { required } from '@/utils/formRules'
- const { t } = useI18n()
- const rules = {
- username: [required],
- password: [required]
- }
- const schema = reactive<FormSchema[]>([
- {
- field: 'username',
- label: t('login.username'),
- component: 'Input',
- colProps: {
- span: 24
- }
- },
- {
- field: 'password',
- label: t('login.password'),
- component: 'InputPassword',
- colProps: {
- span: 24
- },
- componentProps: {
- style: {
- width: '100%'
- }
- }
- },
- {
- field: 'tool',
- colProps: {
- span: 24
- }
- },
- {
- field: 'login',
- colProps: {
- span: 24
- }
- },
- {
- field: 'other',
- component: 'Divider',
- label: t('login.otherLogin'),
- componentProps: {
- contentPosition: 'center'
- }
- },
- {
- field: 'otherIcon',
- colProps: {
- span: 24
- }
- }
- ])
- const iconSize = 30
- const remember = ref(false)
- </script>
- <template>
- <Form :schema="schema" :rules="rules" label-position="top" hide-required-asterisk size="large">
- <template #tool>
- <div class="flex justify-between items-center w-[100%]">
- <ElCheckbox v-model="remember" :label="t('login.remember')" size="small" />
- <ElLink type="primary" :underline="false">{{ t('login.forgetPassword') }}</ElLink>
- </div>
- </template>
- <template #login>
- <ElButton type="primary" class="w-[100%]">{{ t('login.login') }}</ElButton>
- </template>
- <template #otherIcon>
- <div class="flex justify-between w-[100%]">
- <Icon icon="ant-design:github-filled" :size="iconSize" class="cursor-pointer anticon" />
- <Icon icon="ant-design:wechat-filled" :size="iconSize" class="cursor-pointer anticon" />
- <Icon
- icon="ant-design:alipay-circle-filled"
- :size="iconSize"
- class="cursor-pointer anticon"
- />
- <Icon
- icon="ant-design:weibo-circle-filled"
- :size="iconSize"
- class="cursor-pointer anticon"
- />
- </div>
- </template>
- </Form>
- </template>
- <style lang="less" scoped>
- :deep(.anticon) {
- &:hover {
- color: var(--el-color-primary) !important;
- }
- }
- </style>
|