Skip to content

Commit

Permalink
feat: 登录输入框加一键清空和密码框显示隐藏
Browse files Browse the repository at this point in the history
  • Loading branch information
HOMEDO\zhangjiayun authored and yuntian001 committed Aug 28, 2022
1 parent 9ceeb9b commit f6c1c65
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@
v-model="loginParams.username"
autofocus
:placeholder="t('用户名') + '(示例:admin、editor、viewer)'"
clearable
/>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginParams.password"
:type="showPass ? 'input' : 'password'"
type="password"
:placeholder="t('密码') + '(任意填写即可)'"
>
<template #suffix>
<div class="pointer" @click="showPass = !showPass">
<el-icon-view v-if="showPass"></el-icon-view>
<el-icon-hide v-else></el-icon-hide>
</div>
</template>
</el-input>
clearable
show-password
/>
</el-form-item>
<el-button class="sub" type="primary" @click="login">{{ t('登录') }}</el-button>
</el-form>
Expand All @@ -43,7 +39,6 @@ const route = useRoute();
const router = useRouter();
let loginParams = reactive(new LoginParams());
let { t } = useLocalesI18n();
let showPass = ref(false);
const rules = computed<FormRules>(() => ({
username: [
{
Expand Down

0 comments on commit f6c1c65

Please sign in to comment.