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}" > -
-
+
+