From 74fccdfb14feab53aa1caffd1b30b279af9d2638 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Mon, 16 Apr 2018 23:16:04 -0400 Subject: [PATCH] s6e92 components with data method --- lessons/app.js | 13 ++++++++----- lessons/index.html | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lessons/app.js b/lessons/app.js index 4f6aaf0..4a9f554 100644 --- a/lessons/app.js +++ b/lessons/app.js @@ -1,10 +1,13 @@ -Vue.component('ts-cmp',{ +Vue.component('ts-cmp', { data() { - return { - status: "Critical!", - }; + return {status: 'Critical'}; }, - template: '

Server status {{ status }}

' + template: '

Server status {{ status }}

', + methods: { + changeStatus(){ + this.status = 'Normal'; + } + } }); var app = new Vue({ diff --git a/lessons/index.html b/lessons/index.html index 2358b71..e1be8dc 100644 --- a/lessons/index.html +++ b/lessons/index.html @@ -8,6 +8,8 @@
+
+