File tree Expand file tree Collapse file tree 5 files changed +25
-25
lines changed Expand file tree Collapse file tree 5 files changed +25
-25
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <van-button size =" small" plain type =" primary" >
3
+ <slot />
4
+ </van-button >
5
+ </template >
6
+
7
+ <style scoped>
8
+ .van-button {
9
+ --van-button-border-width : 0 ;
10
+ --van-button-plain-background : opacity;
11
+ }
12
+ </style >
Original file line number Diff line number Diff line change 2
2
import { useRouter } from ' vue-router'
3
3
import type { FieldRule } from ' vant'
4
4
import { useUserStore } from ' @/stores'
5
+ import vw from ' @/utils/inline-px-to-vw'
5
6
6
7
const { t } = useI18n ()
7
8
const router = useRouter ()
@@ -69,10 +70,6 @@ async function getCode() {
69
70
70
71
isGettingCode .value = false
71
72
}
72
-
73
- function handleBackLogin() {
74
- router .push ({ name: ' login' })
75
- }
76
73
</script >
77
74
78
75
<template >
@@ -134,9 +131,9 @@ function handleBackLogin() {
134
131
</div >
135
132
</van-form >
136
133
137
- <div class = " mt-16 text-12 text-[var(--van-primary-color)] " @click = " handleBackLogin " >
134
+ <GhostButton to = " login " block :style = " { 'margin-top': vw(8) } " >
138
135
{{ $t('forgot-password.backToLogin') }}
139
- </div >
136
+ </GhostButton >
140
137
</div >
141
138
</template >
142
139
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { useUserStore } from '@/stores'
4
4
5
5
import logo from ' ~/images/logo.svg'
6
6
import logoDark from ' ~/images/logo-dark.svg'
7
+ import vw from ' @/utils/inline-px-to-vw'
7
8
8
9
const { t } = useI18n ()
9
10
const router = useRouter ()
@@ -49,20 +50,12 @@ async function login(values: any) {
49
50
loading .value = false
50
51
}
51
52
}
52
-
53
- function handleReset() {
54
- router .push ({ name: ' forgot-password' })
55
- }
56
-
57
- function handleRegister() {
58
- router .push ({ name: ' register' })
59
- }
60
53
</script >
61
54
62
55
<template >
63
56
<div class =" m-x-a w-7xl text-center" >
64
57
<div class =" mb-32 mt-20" >
65
- <van-image :src =" dark ? logoDark : logo" class =" h-120 w-120" />
58
+ <van-image :src =" dark ? logoDark : logo" class =" h-120 w-120" alt = " brand logo " />
66
59
</div >
67
60
68
61
<van-form :model =" postData" :rules =" rules" validate-trigger =" onSubmit" @submit =" login" >
@@ -97,13 +90,13 @@ function handleRegister() {
97
90
</div >
98
91
</van-form >
99
92
100
- <div class = " mt-16 text-12 text-[var(--van-primary-color)] " @click = " handleRegister " >
93
+ <GhostButton block to = " register " :style = " { 'margin-top': vw(18) } " >
101
94
{{ $t('login.sign-up') }}
102
- </div >
95
+ </GhostButton >
103
96
104
- <div class = " mt-16 text-12 text-[var(--van-primary-color)] " @click = " handleReset " >
97
+ <GhostButton block to = " forgot-password " >
105
98
{{ $t('login.forgot-password') }}
106
- </div >
99
+ </GhostButton >
107
100
</div >
108
101
</template >
109
102
Original file line number Diff line number Diff line change 2
2
import { useRouter } from ' vue-router'
3
3
import type { FieldRule } from ' vant'
4
4
import { useUserStore } from ' @/stores'
5
+ import vw from ' @/utils/inline-px-to-vw'
5
6
6
7
const { t } = useI18n ()
7
8
const router = useRouter ()
@@ -73,10 +74,6 @@ async function getCode() {
73
74
74
75
isGettingCode .value = false
75
76
}
76
-
77
- function handleBackLogin() {
78
- router .push ({ name: ' login' })
79
- }
80
77
</script >
81
78
82
79
<template >
@@ -147,9 +144,9 @@ function handleBackLogin() {
147
144
</div >
148
145
</van-form >
149
146
150
- <div class = " mt-16 text-12 text-[var(--van-primary-color)] " @click = " handleBackLogin " >
147
+ <GhostButton to = " login " block :style = " { 'margin-top': vw(8) } " >
151
148
{{ $t('register.backToLogin') }}
152
- </div >
149
+ </GhostButton >
153
150
</div >
154
151
</template >
155
152
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export {}
8
8
declare module 'vue' {
9
9
export interface GlobalComponents {
10
10
Chart : typeof import ( './../components/Chart/index.vue' ) [ 'default' ]
11
+ GhostButton : typeof import ( './../components/GhostButton.vue' ) [ 'default' ]
11
12
NavBar : typeof import ( './../components/NavBar.vue' ) [ 'default' ]
12
13
RouterLink : typeof import ( 'vue-router' ) [ 'RouterLink' ]
13
14
RouterView : typeof import ( 'vue-router' ) [ 'RouterView' ]
You can’t perform that action at this time.
0 commit comments