Created
December 7, 2018 07:03
-
-
Save orekyuu/a0624502eefc6ebfc66dbe6f155b2442 to your computer and use it in GitHub Desktop.
inside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<form action="xxxx" method="post"> | |
<input type="hidden" name="_csrf" :value="csrf"> | |
... | |
</form> | |
</template> | |
<script> | |
export default { | |
data: function () { | |
return { | |
csrf: '' | |
}; | |
}, | |
created: function () { | |
//csrfトークンをmetaタグから持ってきてフォームに埋め込む | |
this.csrf = document.getElementsByName('csrfToken')[0].getAttribute('content'); | |
} | |
} | |
</script> | |
<style lang="scss"> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment