단순 코드 기록/Vue

Vue_Lamda

일일일코_장민기 2024. 3. 6. 13:11
728x90
HelloWorld.vue
<template>
  <div>
    {{mesg}}<br>
    {{ username }}<br>
    {{ age }}<br>
    {{ sayEcho() }}<br>
    {{ info() }}
  </div>
</template>

<script>
export default {
    props:{
        mesg: String
    },
    data:function(){
        return {
            username: "홍길동",
            age: "20"
        }
    },
    methods: {
        sayEcho: function(){
            console.log("sayEcho");
            return this.username + "\t" + this.age;
        },
        info: () => {
            console.log("info "+this);  //this는 undefinded
            return this;
        }
       
    },


}
</script>

<style>

</style>

 

'단순 코드 기록 > Vue' 카테고리의 다른 글

Vue_바인딩(v-bind / v-model / lazy / number / trim / select / checkbox)  (0) 2024.03.06
Vue_LifeCycle  (0) 2024.03.06
Vue_Function  (0) 2024.03.06
Vue_v-bind  (0) 2024.03.06
Vue_function_Basic  (0) 2024.03.06