1 回答

TA貢獻1877條經(jīng)驗 獲得超6個贊
看起來你已經(jīng)做了幾乎所有可能的事情。在這個階段,我不得不猜測使用帶有 SPA 的自定義成功頁面不是 Netlify 處理的事情。
我會改為使用AJAX 表單提交。
例如
<form @submit.prevent="handleFormSubmit" ...>
methods: {
async handleFormSubmit ($event) {
const form = $event.target
const body = new URLSearchParams(new FormData(form))
try {
const res = await fetch(form.action, { method: 'POST', body })
if (res.ok) {
this.$router.push({ name: 'thanks' })
} else {
throw res
}
} catch (err) {
console.error(err)
// you don't have an error page but maybe you should add one
}
}
}
添加回答
舉報