wip(Login): Login developing

This commit is contained in:
kailong321200875
2022-01-03 18:01:43 +08:00
parent 3810b8c3b2
commit 4d52f7bf58
21 changed files with 1798 additions and 52 deletions

View File

@@ -3,7 +3,7 @@ import { provide, defineComponent } from 'vue'
import { propTypes } from '@/utils/propTypes'
export default defineComponent({
name: 'VConfigGlobal',
name: 'ConfigGlobal',
inheritAttrs: false,
props: {
size: propTypes.oneOf(['default', 'medium', 'small', 'mini']).def('default')

View File

@@ -1,8 +1,8 @@
import VFrom from './src/Form.vue'
import Form from './src/Form.vue'
export interface VFormExpose {
export interface FormExpose {
count: number
sayHello: () => void
}
export { VFrom }
export { Form }

View File

@@ -16,7 +16,7 @@ import { useRenderRadio } from './components/useRenderRadio'
import { useRenderChcekbox } from './components/useRenderChcekbox'
export default defineComponent({
name: 'VForm',
name: 'Form',
props: {
// 生成Form的布局结构数组
schema: {

View File

@@ -20,10 +20,10 @@ const props = defineProps({
const elRef = ref<ElRef>(null)
const isLocal = computed(() => props.icon.startsWith('icon:'))
const isLocal = computed(() => props.icon.startsWith('svg-icon:'))
const symbolId = computed(() => {
return unref(isLocal) ? `#icon-${props.icon.split('icon:')[1]}` : props.icon
return unref(isLocal) ? `#icon-${props.icon.split('svg-icon:')[1]}` : props.icon
})
const getIconifyStyle = computed(() => {
@@ -76,11 +76,3 @@ watch(
</span>
</ElIcon>
</template>
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-icon';
.@{prefix-cls} {
display: inline-block;
}
</style>

View File

@@ -19,16 +19,19 @@ const emit = defineEmits(['update:modelValue'])
// 生成class前缀
const { getPrefixCls } = useDesign()
const prefixCls = ref(getPrefixCls('input-password'))
// 设置input的type属性
const textType = ref<'password' | 'text'>('password')
function changeTextType() {
textType.value = unref(textType) === 'text' ? 'password' : 'text'
}
// 输入框的值
const valueRef = ref('')
// 监听
watch(
() => valueRef.value,
@@ -36,6 +39,7 @@ watch(
emit('update:modelValue', val)
}
)
// 获取密码强度
const getPasswordStrength = computed(() => {
const value = unref(valueRef)

View File

@@ -0,0 +1,3 @@
import SizeDropdown from './src/SizeDropdown.vue'
export { SizeDropdown }

View File

@@ -0,0 +1,31 @@
<script setup lang="ts">
import { computed } from 'vue'
import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus'
import { useAppStore } from '@/store/modules/app'
import { useCssVar } from '@vueuse/core'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
const appStore = useAppStore()
const sizeMap = computed(() => appStore.sizeMap)
const textColor = useCssVar('--el-text-color-primary', document.documentElement)
function setSize(size: ElememtPlusSzie) {
appStore.setSize(size)
}
</script>
<template>
<ElDropdown trigger="click" @command="setSize">
<Icon icon="mdi:format-size" :color="textColor" class="cursor-pointer" />
<template #dropdown>
<ElDropdownMenu>
<ElDropdownItem v-for="item in sizeMap" :key="item" :command="item">
{{ t(`size.${[item]}`) }}
</ElDropdownItem>
</ElDropdownMenu>
</template>
</ElDropdown>
</template>

View File

@@ -7,6 +7,7 @@ import { useDesign } from '@/hooks/web/useDesign'
import { useIcon } from '@/hooks/web/useIcon'
const Sun = useIcon({ icon: 'emojione-monotone:sun' })
const CrescentMoon = useIcon({ icon: 'emojione-monotone:crescent-moon' })
const appStore = useAppStore()
@@ -15,6 +16,7 @@ const appStore = useAppStore()
const isDark = ref(appStore.getIsDark)
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('theme-switch')
// 设置switch的背景颜色