feat: 默认展示二维码登录
This commit is contained in:
@@ -23,7 +23,7 @@ const loginFormType = computed(() => loginFromStore.LoginFormType);
|
||||
// 使用 defineModel 定义双向绑定的 visible(需 Vue 3.4+)
|
||||
const visible = defineModel<boolean>('visible');
|
||||
const showMask = ref(false); // 控制遮罩层显示的独立状态
|
||||
const isQrMode = ref(false);
|
||||
const isQrMode = ref(true);
|
||||
const userStore = useUserStore();
|
||||
const router = useRouter();
|
||||
const sessionStore = useSessionStore();
|
||||
@@ -34,7 +34,7 @@ watch(
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
// 恢复默认
|
||||
isQrMode.value = false;
|
||||
isQrMode.value = true;
|
||||
// 显示时立即展示遮罩
|
||||
showMask.value = true;
|
||||
}
|
||||
@@ -284,13 +284,15 @@ function openContact() {
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<!-- 隐藏二维码登录 -->
|
||||
<div class="mode-toggle" @click.stop="toggleLoginMode">
|
||||
<SvgIcon v-if="!isQrMode" name="erweimadenglu" />
|
||||
<SvgIcon v-else name="zhanghaodenglu" />
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
<div v-if="!isQrMode" class="form-box">
|
||||
<div v-if="isQrMode" class="qr-container">
|
||||
<QrCodeLogin />
|
||||
</div>
|
||||
<div v-else class="form-box">
|
||||
<!-- 表单容器,父组件可以自定定义表单插槽 -->
|
||||
<slot name="form">
|
||||
<!-- 父组件不用插槽则显示默认表单 默认使用 AccountPassword 组件 -->
|
||||
@@ -357,9 +359,6 @@ function openContact() {
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div v-else class="qr-container">
|
||||
<QrCodeLogin />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user