Created
July 24, 2020 07:09
-
-
Save pandanote-info/51bfd68a73ddb521a69092381c364280 to your computer and use it in GitHub Desktop.
axiosを使ってデータを取得するためのVue.jsの記述例
This file contains 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
<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