Display a preliminary room teaser

This commit is contained in:
Ramon Wenger 2018-09-05 16:03:45 +02:00
parent 52d6d20194
commit 318892f55c
1 changed files with 11 additions and 3 deletions

View File

@ -32,9 +32,17 @@
return '';
},
teaser() {
// if (this.contents && this.contents.length) {
// if (this.contents[0].type === 'link')
// }
if (this.contents && this.contents.length) {
let first = this.contents.find(content => content.type !== 'image_url');
switch (first.type) {
case 'text_block':
return first.value.text;
case 'link_block':
return first.value.url;
default:
return ''
}
}
return '';
}
}