Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Created July 24, 2020 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/51bfd68a73ddb521a69092381c364280 to your computer and use it in GitHub Desktop.
Save pandanote-info/51bfd68a73ddb521a69092381c364280 to your computer and use it in GitHub Desktop.
axiosを使ってデータを取得するためのVue.jsの記述例
<script>
new Vue({
el: '#app',
data: {
msg: null,
rawmsg: "",
newad: "",
status: ""
},
methods: {
getList() {
axios.get("/api/get")
.then(response => {
this.msg = response.data
})
.catch(error => {})
},
reset() {
this.msg = []
}
},
mounted(){
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment