Skip to content

Commit 1ea6dfc

Browse files
committed
fix(login): improve border css on code login
1 parent 1ead2bb commit 1ea6dfc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/views/login/LoginComponent.vue

+11-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ const getCodes = async () => {
9191
};
9292
9393
const poll = ref<CancellablePolling>();
94-
const progress = ref(0);
9594
const progressInterval = ref<ReturnType<typeof setInterval>>();
95+
const progress = ref(0);
96+
const progressRounded = computed(() => Math.round(progress.value * 10) / 20 || 0.1);
9697
9798
const onCancel = () => {
9899
if (poll.value) poll.value.cancel();
@@ -174,6 +175,7 @@ onDeactivated(() => onCancel());
174175
<div class="code-input" :class="{ show: useCode }">
175176
<NInputGroup class="input-group">
176177
<NInput
178+
:style="{ '--n-border-radius': '3px 0 0 0' }"
177179
:value="code"
178180
placeholder="Code"
179181
:disabled="!code?.length"
@@ -194,7 +196,7 @@ onDeactivated(() => onCancel());
194196
class="timeout-code"
195197
type="line"
196198
status="success"
197-
:percentage="progress"
199+
:percentage="progressRounded"
198200
:show-indicator="false"
199201
:theme-overrides="{
200202
railHeight: 'var(--rail-height)',
@@ -243,14 +245,21 @@ onDeactivated(() => onCancel());
243245
244246
.input-group {
245247
position: relative;
248+
justify-content: center;
246249
}
247250
248251
.timeout-code {
249252
--rail-height: 2px;
250253
251254
position: absolute;
252255
bottom: calc(var(--rail-height) * -1);
256+
left: 1px; // border width
253257
border-radius: 0;
258+
259+
:deep(.n-progress-graph-line-rail),
260+
:deep(.n-progress-graph-line-rail .n-progress-graph-line-fill) {
261+
border-radius: 0;
262+
}
254263
}
255264
}
256265
</style>

0 commit comments

Comments
 (0)