Vue.js 예제 01

2019-11-16

선언적 렌더링

캡처

Vue.js의 핵심에는 간단한 템플릿 구문을 사용하여 문서 객체 모델(The Document Object Model, 이하 DOM)에서 데이터를 선언적으로 렌더링 할 수있는 시스템이 있다.


2

v-on 디렉티브를 사용하여 Vue 인스턴스에서 메소드를 호출한다

<form v-on:submit="onSubmitForm">
<button type="submit"></buttom></form>

submit 후 refresh되는걸 막기 위해 preventDefault()를 추가했다.

onSubmitForm(e) {
                e.preventDefault();
                if{}
                else{}
}