服务器响应示例:
return response()->json(['message' => __('messages.g-captcha')], 422);
return response()->json(
['message' => 'Success!'], 200);
提交表单时,会出现一个带有相应颜色的块,但其中没有任何消息
<form method="post" action-xhr="{{route('amp.synonyms.submittingEditForm')}}" target="_top">
<div class="p-3 mt-2 rounded bg-teal-200 text-teal-800 mb-3" submit-success>
<template type="amp-mustache" id="amp-template-custom-success">
@{{message}}
</template>
</div>
<div class="p-3 mt-2 rounded bg-red-200 text-red-800 mb-3" submit-error>
<template type="amp-mustache" id="amp-template-custom-error">
@{{message}}
</template>
</div>
<fieldset>
...
</fieldset></form>