From f97f01c6dabee5774ffdb718e768e2bca0026077 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Fri, 13 Apr 2018 14:57:51 -0400 Subject: [PATCH] s2e27 using objects --- app.js | 8 ++++++++ index.html | 10 ++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index b1865ab..639c544 100644 --- a/app.js +++ b/app.js @@ -5,4 +5,12 @@ var app = new Vue({ attachGreen: false, attachBlue: true }, + computed:{ + divClasses(){ + return { + red: this.attachRed, + blue: !this.attachRed + } + } + } }); diff --git a/index.html b/index.html index 583cc5e..2dc2acc 100644 --- a/index.html +++ b/index.html @@ -11,14 +11,8 @@ @click="attachRed = !attachRed" :class="{red: attachRed}" > -
-
+
+