[Vue] 조건부 렌더링 v-if


[Vue] 조건부 렌더링 v-if

이전 포스트에서 v-if에 대해서 정리한 적이 있었는 데 v-if에 대해서 좀 더 자세히 알아보는 내용이다. 하단의 소스는 colorState의 값에 따라 다른 class를 바인딩하는 예제이다. <!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Vue test</title> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <style> .box { width: 100px; height: 100px; } .box--red { background-color: red; } .box--blue {...


#else #조건부 #자바스크립트 #렌더링 #vuejs #vue #js #javascript #if #elseif #조건부렌더링

원문링크 : [Vue] 조건부 렌더링 v-if