Skip to content

Commit

Permalink
feat: add inputPassword demo
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Mar 27, 2022
1 parent 743ecc1 commit 8f8b126
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 10 deletions.
9 changes: 9 additions & 0 deletions mock/role/index.ts
Expand Up @@ -249,6 +249,14 @@ const adminList = [
meta: {
title: 'router.infotip'
}
},
{
path: 'input-password',
component: 'views/Components/InputPassword',
name: 'InputPassword',
meta: {
title: 'router.inputPassword'
}
}
]
},
Expand Down Expand Up @@ -468,6 +476,7 @@ const testList: string[] = [
'/components/qrcode',
'/components/highlight',
'/components/infotip',
'/Components/InputPassword',
'/hooks',
'/hooks/useWatermark',
'/level',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog/src/Dialog.vue
Expand Up @@ -73,7 +73,7 @@ const dialogStyle = computed(() => {
</slot>
<Icon
v-if="fullscreen"
class="mr-15px cursor-pointer is-hover"
class="mr-11px cursor-pointer is-hover mt-2px"
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
color="var(--el-color-info)"
@click="toggleFull"
Expand Down
2 changes: 1 addition & 1 deletion src/components/InputPassword/src/InputPassword.vue
Expand Up @@ -85,7 +85,7 @@ const getIconName = computed(() =>
}
&__bar {
background-color: var(--el-text-color-disabled-base);
background-color: var(--el-text-color-disabled);
border-radius: var(--el-border-radius-base);
&::before,
Expand Down
2 changes: 1 addition & 1 deletion src/config/app.ts
Expand Up @@ -66,7 +66,7 @@ export const appModules: AppState = {

layout: wsCache.get('layout') || 'classic', // layout布局
isDark: wsCache.get('isDark') || false, // 是否是暗黑模式
currentSize: wsCache.get('default') || 'default', // 组件尺寸
currentSize: wsCache.get('default') || '', // 组件尺寸
theme: wsCache.get('theme') || {
// 主题色
elColorPrimary: '#409eff',
Expand Down
7 changes: 6 additions & 1 deletion src/locales/en.ts
Expand Up @@ -131,7 +131,8 @@ export default {
authorization: 'Authorization',
user: 'User management',
role: 'Role management',
document: 'Document'
document: 'Document',
inputPassword: 'InputPassword'
},
analysis: {
newUser: 'New user',
Expand Down Expand Up @@ -411,5 +412,9 @@ export default {
remark: 'Remark',
remarkMessage1: 'Back end control routing permission',
remarkMessage2: 'Front end control routing permission'
},
inputPasswordDemo: {
title: 'InputPassword',
inputPasswordDes: 'Secondary packaging of Input components based on ElementPlus'
}
}
9 changes: 7 additions & 2 deletions src/locales/zh-CN.ts
Expand Up @@ -131,7 +131,8 @@ export default {
authorization: '权限管理',
user: '用户管理',
role: '角色管理',
document: '文档'
document: '文档',
inputPassword: '密码输入框'
},
analysis: {
newUser: '新增用户',
Expand Down Expand Up @@ -374,7 +375,7 @@ export default {
},
descriptionsDemo: {
descriptions: '描述',
descriptionsDes: '基于 ElementPlus 的 descriptions 组件二次封装',
descriptionsDes: '基于 ElementPlus 的 Descriptions 组件二次封装',
username: '用户名',
nickName: '昵称',
phone: '联系电话',
Expand Down Expand Up @@ -407,5 +408,9 @@ export default {
remark: '备注',
remarkMessage1: '后端控制路由权限',
remarkMessage2: '前端控制路由权限'
},
inputPasswordDemo: {
title: '密码输入框',
inputPasswordDes: '基于 ElementPlus 的 Input 组件二次封装'
}
}
8 changes: 8 additions & 0 deletions src/router/index.ts
Expand Up @@ -300,6 +300,14 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
meta: {
title: t('router.infotip')
}
},
{
path: 'input-password',
component: () => import('@/views/Components/InputPassword.vue'),
name: 'InputPassword',
meta: {
title: t('router.inputPassword')
}
}
]
},
Expand Down
13 changes: 9 additions & 4 deletions src/views/Components/Icon.vue
Expand Up @@ -12,6 +12,11 @@ const keyClick = (key: string) => {
window.open('https://iconify.design/')
}
}
const peoples = useIcon({ icon: 'svg-icon:peoples' })
const money = useIcon({ icon: 'svg-icon:money' })
const aim = useIcon({ icon: 'ep:aim' })
const alarmClock = useIcon({ icon: 'ep:alarm-clock' })
</script>

<template>
Expand Down Expand Up @@ -48,10 +53,10 @@ const keyClick = (key: string) => {
</ContentWrap>
<ContentWrap title="useIcon">
<div class="flex justify-between">
<ElButton :icon="useIcon({ icon: 'svg-icon:peoples' })">Button</ElButton>
<ElButton :icon="useIcon({ icon: 'svg-icon:money' })">Button</ElButton>
<ElButton :icon="useIcon({ icon: 'ep:aim' })">Button</ElButton>
<ElButton :icon="useIcon({ icon: 'ep:alarm-clock' })">Button</ElButton>
<ElButton :icon="peoples">Button</ElButton>
<ElButton :icon="money">Button</ElButton>
<ElButton :icon="aim">Button</ElButton>
<ElButton :icon="alarmClock">Button</ElButton>
</div>
</ContentWrap>
</template>
21 changes: 21 additions & 0 deletions src/views/Components/InputPassword.vue
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { ContentWrap } from '@/components/ContentWrap'
import { useI18n } from '@/hooks/web/useI18n'
import { InputPassword } from '@/components/InputPassword'
import { ref } from 'vue'
const { t } = useI18n()
const password = ref('')
</script>

<template>
<ContentWrap
:title="t('inputPasswordDemo.title')"
:message="t('inputPasswordDemo.inputPasswordDes')"
>
<InputPassword v-model="password" class="mb-20px" />
<InputPassword v-model="password" strength />
<InputPassword v-model="password" strength disabled class="mt-20px" />
</ContentWrap>
</template>

0 comments on commit 8f8b126

Please sign in to comment.