From 6d281326bcb74ce86ed2d4fe7c624f60a4944ae8 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 25 Jan 2021 12:26:42 +0100 Subject: [PATCH] add a component --- cmp-intro-01-starting-setup/app.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmp-intro-01-starting-setup/app.js b/cmp-intro-01-starting-setup/app.js index 9e2abe5..0bd3a4c 100644 --- a/cmp-intro-01-starting-setup/app.js +++ b/cmp-intro-01-starting-setup/app.js @@ -19,7 +19,20 @@ const app = Vue.createApp({ ], }; }, - methods: {}, +}); + +// use multiword component names +app.component("user-contact", { + data() { + return { + detailsAreVisible: false, + }; + }, + methods: { + toggleDetails() { + this.detailsAreVisible = !this.detailsAreVisible; + }, + }, }); app.mount("#app");