在Vue.JS中创建表单并与Netlify的表单提交处理程序连接。无法重定向到自定义的谢谢页面。 Netlify的默认“谢谢”页面始终出现。
在文档和论坛上搜索了一段时间,但无济于事。>>
我已经正确设置了路由以处理新页面/成功。在下面,您可以看到我已向表单添加了一个动作,该动作应采用正确的格式。
我认为问题可能与Vue.JS路由有关,或者是Netlify识别/ success是否为活动组件/页面的方式。如netlify文档中所述,如果操作路径无效,则它将自动默认返回netlify的“谢谢”页面。
https://github.com/DanielGibsonOrchid/freightlegend
https://freightlegend.netlify.com/
<form action="/success" class="get-started-form" name="get-started" method="post" data-netlify="true" data-netlify-honeypot="bot-field" > <input type="hidden" name="bot-field" /> <input type="hidden" name="form-name" value="get-started" /> <div class="form-content flex"> <input type="text" name="name" placeholder="Your name" class="input-main" required /> <input type="email" name="email" placeholder="Your email" class="input-main input-margin" required /> <div class="select-div"> <select name="country" class="input-main"> <option value="New Zealand">New Zealand</option> <option value="Australia">Australia</option> <option value="USA">USA</option> <option value="Other">Other</option> </select> </div> </div> <input type="submit" class="btn-main" /> <!-- <button type="submit" class="btn-main">Submit Query</button> --> </form>
public/_redirects
/locale.json /locales/us.json 302 Country=us
/locale.json /locales/au.json 302 Country=au
/locale.json /locales/nz.json 302 Country=nz
/* /index.html 200
在Vue.JS中创建表单并与Netlify的表单提交处理程序连接。无法重定向到自定义的谢谢页面。 Netlify的默认“谢谢”页面始终出现。在doc上搜索了一会儿...
看起来您已经完成了几乎所有可能的事情。在此阶段,我不得不猜测Netlify无法处理将自定义成功页面与SPA结合使用。