Add component class to content component
This commit is contained in:
parent
7fb61d9f05
commit
69e19591b3
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
:class="{'content-component--bookmarked': bookmarked}"
|
:class="componentClass"
|
||||||
:data-scrollto="component.id"
|
:data-scrollto="component.id"
|
||||||
class="content-component">
|
>
|
||||||
<bookmark-actions
|
<bookmark-actions
|
||||||
:bookmarked="bookmarked"
|
:bookmarked="bookmarked"
|
||||||
:note="note"
|
:note="note"
|
||||||
|
|
@ -80,6 +80,13 @@
|
||||||
},
|
},
|
||||||
showBookmarkActions() {
|
showBookmarkActions() {
|
||||||
return this.component.type !== 'content_list' && this.component.type !== 'basic_knowledge' && !this.editModule;
|
return this.component.type !== 'content_list' && this.component.type !== 'basic_knowledge' && !this.editModule;
|
||||||
|
},
|
||||||
|
componentClass() {
|
||||||
|
let classes = ['content-component', `content-component--${this.component.type}`];
|
||||||
|
if (this.bookmarked) {
|
||||||
|
classes.push('content-component--bookmarked');
|
||||||
|
}
|
||||||
|
return classes;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue