Html-JavaScript

Vue.js 기본 구조

빤따스뤽 2024. 2. 28. 16:01

 

<template>
</template>

<script>
export default {
  name: "sample", //컴포넌트 이름
  components: {}, // 외부 컴포턴트를 사용하게 되면, 해당 컴포넌트를 import한 후 등록 해주어야 한다.
  data() {
    return {
    };
  }, // 전역 데이터 선언 (html, js간의 양방향 데이터 방린딩 가능하며, 데이터 프로퍼티는 this로 접근해야 한다.
  setup() {}, // 컴포지션 API를 구현하는 메소드
  created() {}, // 컴포넌트 생성시 실행
  mounted() {}, // template에 정의된 html코드가 랜더링 된 후 실행
  unmounted() {}, // unmount 이후 실행
  methods: {} // 컴포넌트 내에서 사용할 메소드 정의

};
</script>

<style>
</style>

참고 : https://seungdols.tistory.com/959