관리 메뉴

moozi

vuejsAxios.html 본문

TIS_2020/응용SW2020_1기

vuejsAxios.html

moozi 2020. 5. 12. 13:35

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>Axios</title>

</head>

<body>

    <div id="app">

        <button v-on:click="fetchData">get data</button>

    </div>

    <script src="https://unpkg.com/vue"></script>

    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

    <script>

        new Vue({

            el: '#app',

            methods: {

                fetchData: function() {

                axios.get('https://jsonplaceholder.typicode.com/users/')

                    .then(function(response) {

                    console.log(response);

                    })

                    .catch(function(error) {

                    console.log(error);

                    });

                }

            }

        });

    </script>

</body>

</html>

'TIS_2020 > 응용SW2020_1기' 카테고리의 다른 글

vuejsAjax03.html  (0) 2020.05.12
vuejsAjax02.html with Axios  (0) 2020.05.12
vuejsAxios.html  (0) 2020.05.12
vuejsAjax01  (0) 2020.05.12
vue.js ajax  (0) 2020.05.12
jquery03.html  (0) 2020.05.06
0 Comments
댓글쓰기 폼