|
52 | 52 | </tiny-tooltip> |
53 | 53 | </tiny-form-item> |
54 | 54 | <tiny-form-item> |
55 | | - <tiny-button type="primary" @click="handleForgot"> 提交</tiny-button> |
| 55 | + <tiny-button :class="{ successBg: isReady }" type="primary" @click="handleForgot"> 提交</tiny-button> |
56 | 56 | </tiny-form-item> |
57 | 57 | </tiny-form> |
58 | 58 | <div class="forgot-bottom"> |
|
62 | 62 | </template> |
63 | 63 |
|
64 | 64 | <script lang="ts"> |
65 | | -import { reactive, watch } from 'vue' |
| 65 | +import { reactive, watch, computed } from 'vue' |
66 | 66 | import { TinyForm, TinyFormItem, TinyInput, TinyButton, TinyTooltip } from '@opentiny/vue' |
67 | 67 | import useLogin from './js/useLogin' |
68 | 68 | import { getMetaApi, META_SERVICE } from '@opentiny/tiny-engine-meta-register' |
@@ -90,6 +90,17 @@ export default { |
90 | 90 | rules: [...useLogin().passwordRules] |
91 | 91 | }) |
92 | 92 |
|
| 93 | + const isReady = computed(() => { |
| 94 | + return ( |
| 95 | + state.forgotData.username && |
| 96 | + state.forgotData.password && |
| 97 | + state.forgotData.key && |
| 98 | + state.forgotData.confirmPassword && |
| 99 | + !state.pwManualShow && |
| 100 | + state.forgotData.confirmPassword === state.forgotData.password |
| 101 | + ) |
| 102 | + }) |
| 103 | +
|
93 | 104 | const handleConfirmPwChange = () => { |
94 | 105 | if (state.forgotData.confirmPassword !== state.forgotData.password) { |
95 | 106 | state.confirmManualShow = true |
@@ -146,6 +157,7 @@ export default { |
146 | 157 | ) |
147 | 158 | return { |
148 | 159 | state, |
| 160 | + isReady, |
149 | 161 | handleForgot, |
150 | 162 | toLogin |
151 | 163 | } |
@@ -188,6 +200,10 @@ export default { |
188 | 200 | } |
189 | 201 | } |
190 | 202 |
|
| 203 | +.successBg { |
| 204 | + background: #191919 !important; |
| 205 | +} |
| 206 | +
|
191 | 207 | :deep(.tiny-form-item__content) { |
192 | 208 | margin-left: 0 !important; |
193 | 209 | } |
|
0 commit comments