Libraries show name in page title
This commit is contained in:
@@ -7,12 +7,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="js">
|
<script lang="js">
|
||||||
import SingleCardLayout from '/imports/ui/layouts/SingleCardLayout.vue';
|
import SingleCardLayout from '/imports/ui/layouts/SingleCardLayout.vue';
|
||||||
import LibraryAndNode from '/imports/ui/library/LibraryAndNode.vue';
|
import LibraryAndNode from '/imports/ui/library/LibraryAndNode.vue';
|
||||||
export default {
|
import Libraries from '/imports/api/library/Libraries.js';
|
||||||
components: {
|
|
||||||
SingleCardLayout,
|
export default {
|
||||||
LibraryAndNode,
|
components: {
|
||||||
},
|
SingleCardLayout,
|
||||||
};
|
LibraryAndNode,
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'library.name'(newName) {
|
||||||
|
this.$store.commit('setPageTitle', newName || 'Library');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$store.commit('setPageTitle', this.library && this.library.name || 'Library');
|
||||||
|
},
|
||||||
|
meteor: {
|
||||||
|
library(){
|
||||||
|
let libraryId = this.$route.params.id;
|
||||||
|
if (!libraryId) return;
|
||||||
|
return Libraries.findOne(libraryId, {fields: {name: 1}});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user