From eaaee61978f214f7ed12711bce50bca576e07073 Mon Sep 17 00:00:00 2001 From: Edwina Barbalan Date: Mon, 26 Nov 2018 12:57:52 +0100 Subject: [PATCH] Vue komponenten erstellt - Nachrichtenfelder --- public/home.js | 46 +++++++++++++++++++++++++++ public/index.html | 79 +++++++++++++++++++---------------------------- 2 files changed, 77 insertions(+), 48 deletions(-) diff --git a/public/home.js b/public/home.js index 912075b..1a25f80 100644 --- a/public/home.js +++ b/public/home.js @@ -1,3 +1,49 @@ +Vue.component('msg-item', { + template: `
+
+
+ {{ title }} + +

+ {{ subject }}

+ {{ tag }}

+
+ account_circle + Erstellt von {{ user }} +
`, + props: ['title', 'subject', 'tag', 'user'] +}) + +new Vue({ + el: '#mewmessages-example', + data: { + messages: [ + { + id: 1, + title: 'Betreff_1', + subject: 'Nachricht_1', + tag: '#tag_1', + user: 'user_1' + }, + { + id: 2, + title: 'Betreff_2', + subject: 'Nachricht_2', + tag: '#tag_2', + user: 'user_2' + }, + { + id: 3, + title: 'Betreff_3', + subject: 'Nachricht_3', + tag: '#tag_3', + user: 'user_3' + } + ], + }, +}) + + /* First try of vue-componetn -> does not work Vue.component('home', { data: function () { diff --git a/public/index.html b/public/index.html index 5688865..7cf3f48 100644 --- a/public/index.html +++ b/public/index.html @@ -34,26 +34,43 @@
+ +
+
+
+
+
+ + - + + + --> - +