Skip to Content
실전 코드로 배우는 Vue.js
book

실전 코드로 배우는 Vue.js

by 마야 셰빈, 정병열
October 2024
Beginner to intermediate
452 pages
9h 28m
Korean
Hanbit Media, Inc.
Content preview from 실전 코드로 배우는 Vue.js
113
CHAPTER 03
컴포넌트 구성
그림
3-11
두 번째 렌더링의 두 번째 렌더링의
MyFirstComponentMyFirstComponent
타임라인 타임라인
라이프사이클 훅은 여러 모로 쓸모가 많다. [표
3
-
1
]은 각 훅의 가장 대표적인 사용 사례다.
3-1
훅의 올바른 사용 사례 훅의 올바른 사용 사례
라이프사이클 훅 사용 요건
beforeCreate
컴포넌트 데이터를
변경하지 않으면서
외부 로직을 로드해야 하는 경우
created
외부 데이터를 컴포넌트에 로드해야 하는 경우. 외부 리소스 데이터를 읽거나 쓸 경우
mounted
훅보다 먼저 고려한다.
mounted
DOM
을 조작하거나 컴포넌트
DOM
노드에 접근하기 위해
this
.$
el
이 필요한 경우
지금까지 컴포넌트 라이프사이클의 순서와 각각에 관련된 훅을 배웠다. 다음으로
methods
프로퍼티를 통해 공통 컴포넌트 로직 메서드를 구성하는 방법을 알아보자.
3.43.4
메서드 메서드
메서드 로직은 일반적으로 컴포넌트 데이터에 의존하지 않도록 작성한다. 그러나
this
스턴스를 사용하면 메서드 내부에서 컴포넌트의 로컬 상태에 접근할 수는 있다. 컴포넌트의
메서드는
methods
프로퍼티에 함수 형태로 정의한다. [예제
3
-
8
]은
message
프로퍼티를
114
실전 코드로 배우는 Vue.js ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

실전 자바 소프트웨어 개발: 4가지 프로젝트로 배우는 최신 자바 개발 기법

실전 자바 소프트웨어 개발: 4가지 프로젝트로 배우는 최신 자바 개발 기법

우정은, 라울-게이브리얼 우르마, 리처드 워버턴
자바스크립트 + 리액트 디자인 패턴

자바스크립트 + 리액트 디자인 패턴

애디 오스마니(Addy Osmani)
실무로 통하는 타입스크립트

실무로 통하는 타입스크립트

슈테판 바움가르트너

Publisher Resources

ISBN: 9791169212991