관리 메뉴

moozi

vuejsAjax03.html 본문

TIS_2020/응용SW2020_1기

vuejsAjax03.html

moozi 2020. 5. 12. 14:03

<html>

  <head>

      <meta charset="utf-8">

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

      <title>Vue Router</title>

  </head>

  <body>

 

        <div id='app'>

            <form action="memberUpdate.jsp">

                name <input type="text" name="name" v-model="name"><br>

                address <input type="text" name="address" v-model="address"><br>

                <input type="submit" value="회원정보수정">

            </form>

        </div>

 

    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.2/dist/vue.js"></script>

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

    <script>

 

    var app = new Vue({

      el: '#app',

      data: {

            name: "",

            address: ""

    },

      methods: {

        getData: function(){

          axios.get('http://pjs.dothome.co.kr/ajaxDB3.php')

          .then((response)=>{

            this.name = response.data.name;

            this.addressresponse.data.address;

 

        //    this.data= response.data;

        })

          .catch(function(e){

            console.error(e);

          })

        }

      }

    });

    app.getData();

    </script>

  </body>

</html>



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

vuejsAjax.zip  (0) 2020.05.12
vuejsAjax04 with jQuery $.ajax()  (0) 2020.05.12
vuejsAjax02.html with Axios  (0) 2020.05.12
vuejsAxios.html  (0) 2020.05.12
vuejsAjax01  (0) 2020.05.12
Comments