@fy-/fws-vue 2.1.8 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/fws/UserFlow.vue +22 -0
- package/package.json +1 -1
|
@@ -62,6 +62,24 @@ const formData = ref<Record<string, any>>({
|
|
|
62
62
|
})
|
|
63
63
|
const completed = ref(false)
|
|
64
64
|
|
|
65
|
+
function autocompleteValue(fieldName: string): string | undefined {
|
|
66
|
+
switch (fieldName) {
|
|
67
|
+
case 'username':
|
|
68
|
+
return 'username'
|
|
69
|
+
case 'password':
|
|
70
|
+
return 'current-password'
|
|
71
|
+
case 'password2':
|
|
72
|
+
case 'confirm':
|
|
73
|
+
return 'new-password'
|
|
74
|
+
case 'email':
|
|
75
|
+
return 'email'
|
|
76
|
+
case 'phone_number':
|
|
77
|
+
return 'tel'
|
|
78
|
+
default:
|
|
79
|
+
return undefined
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
async function doTrigger(field: any) {
|
|
66
84
|
// eslint-disable-next-line no-eval
|
|
67
85
|
const _res = await eval(
|
|
@@ -158,8 +176,11 @@ async function userFlow(params: paramsType = { initial: false }) {
|
|
|
158
176
|
return
|
|
159
177
|
}
|
|
160
178
|
formData.value = {
|
|
179
|
+
...formData.value,
|
|
161
180
|
session: response.value.data.session,
|
|
162
181
|
}
|
|
182
|
+
delete formData.value.initial
|
|
183
|
+
|
|
163
184
|
session.value = response.value.data.session
|
|
164
185
|
inputs.value = []
|
|
165
186
|
responseFields.value = response.value.data.fields
|
|
@@ -310,6 +331,7 @@ onMounted(async () => {
|
|
|
310
331
|
:error="fieldsError[field.name]"
|
|
311
332
|
:type="field.type"
|
|
312
333
|
:req="responseReq.includes(field.name)"
|
|
334
|
+
:autocomplete="autocompleteValue(field.name)"
|
|
313
335
|
/>
|
|
314
336
|
</template>
|
|
315
337
|
</template>
|