2018-12-05 14:42:02 +01:00
Vue . component ( 'Home' , {
template : ` <div id="message-list">
2018-11-29 11:40:23 +01:00
< div class = "om-card card" >
2018-11-26 12:57:52 +01:00
< h6 class = "msg-head" >
2018-11-28 14:33:31 +01:00
< b > { { subject } } < / b >
2018-11-26 12:57:52 +01:00
< img src = "favicon.ico" width = 20 px height = 20 px >
2018-11-28 14:33:31 +01:00
< / h 6 >
{ { message } } < br > < br >
2018-11-26 12:57:52 +01:00
< a href = "#" > { { tag } } < / a > < / p >
< div class = "om-user-line" >
< i class = "material-icons" > account _circle < / i >
Erstellt von { { user } }
2018-12-05 14:42:02 +01:00
< / d i v > < / d i v > < / d i v > ` ,
2018-11-28 14:33:31 +01:00
props : [ 'subject' , 'message' , 'tag' , 'user' ]
2018-11-26 12:57:52 +01:00
} )
new Vue ( {
2018-11-28 14:33:31 +01:00
el : '#message-list' ,
2018-11-26 12:57:52 +01:00
data : {
messages : [
{
id : 1 ,
2018-11-29 09:46:47 +01:00
subject : 'Betreff' ,
2018-11-28 14:33:31 +01:00
message : 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.' ,
tag : '#efi #bme #semester' ,
2018-11-26 12:57:52 +01:00
user : 'user_1'
} ,
{
id : 2 ,
2018-11-29 09:46:47 +01:00
subject : 'Betreff' ,
2018-11-28 14:33:31 +01:00
message : 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.' ,
tag : '#efi #fachschaft' ,
2018-11-26 12:57:52 +01:00
user : 'user_2'
} ,
{
id : 3 ,
2018-11-29 09:46:47 +01:00
subject : 'Betreff' ,
2018-11-28 14:33:31 +01:00
message : 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.' ,
tag : '#efi #bei #wichtig' ,
2018-11-26 12:57:52 +01:00
user : 'user_3'
}
] ,
} ,
} )
2018-11-22 15:00:09 +01:00
/ * F i r s t t r y o f v u e - c o m p o n e t n - > d o e s n o t w o r k
Vue . component ( 'home' , {
data : function ( ) {
return {
}
} ,
template :
` <div id="sample">
< div v - for = "msgs in private.messages" >
< div class = "om-card card" v - for = "elements in msgs.message" >
< h6 class = "msg-head" >
< b > { { elements . subject } } < / b >
< img src = "favicon.ico" width = 20 px height = 20 px >
< / h 6 >
< p > { { elements . msg } } < br >
< a href = "#" > { { elements . tags } } < / a > < / p >
< div class = "om-user-line" >
< i class = "material-icons" > account _circle < / i >
Erstellt von { { elements . user } }
< / d i v >
< / d i v >
< / d i v >
< / d i v > `
} )
* /