mirror of
https://github.com/web3privacy/explorer-app.git
synced 2024-10-15 16:46:26 +02:00
fix: validations
This commit is contained in:
parent
a3cb839f2d
commit
ed9e80af29
3 changed files with 13 additions and 12 deletions
|
@ -38,8 +38,8 @@ resetForm({
|
|||
},
|
||||
})
|
||||
|
||||
function isFormValid() {
|
||||
validate()
|
||||
async function isFormValid() {
|
||||
await validate()
|
||||
|
||||
if (meta.value.valid) {
|
||||
return true
|
||||
|
|
|
@ -108,7 +108,7 @@ async function next() {
|
|||
return
|
||||
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ async function next() {
|
|||
|
||||
async function publish() {
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ async function publish() {
|
|||
navigateTo(`/project/${project.value?.id || project.value?.name?.toLowerCase().replace(/\s+/g, '-')}`)
|
||||
}
|
||||
|
||||
function jumpTo(tab: string) {
|
||||
async function jumpTo(tab: string) {
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
|
|
@ -89,9 +89,9 @@ function save() {
|
|||
})
|
||||
}
|
||||
|
||||
function next() {
|
||||
async function next() {
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ function next() {
|
|||
|
||||
async function publish() {
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
@ -119,9 +119,10 @@ async function publish() {
|
|||
navigateTo('/')
|
||||
}
|
||||
|
||||
function jumpTo(tab: string) {
|
||||
async function jumpTo(tab: string) {
|
||||
console.log(tab, selectedTab.value)
|
||||
if (selectedTab.value === 'basic_info') {
|
||||
if (!currentComponent.value.isFormValid())
|
||||
if (!(await currentComponent.value.isFormValid()))
|
||||
return
|
||||
else save()
|
||||
}
|
||||
|
@ -273,7 +274,7 @@ const transitionDone = ref(false)
|
|||
pb-8px
|
||||
leading-40px
|
||||
:class="selectedTab === tab.value ? 'font-bold border-b-4 border-app-white' : ''"
|
||||
@click="selectedTab = tab.value"
|
||||
@click="jumpTo(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue