adding image to the header #104
-
Hello there, I'm new to Vue.js so I'm struggling a bit with a simple thing, I would like to add a logo next to the title in the header, I've tried a lot of things but I keep getting errors. Do you have a tuto or an example to show me so I can understand how it works please ? Or maybe it is already implemeted in the config file and I missed it ? Thank you for your help ! Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey @Docrom, this is a really good idea! Nope, it's not already available, but it should be. So first off you'd add a new attribute to your And then, I think the best place to implement it would be next to the page title, in export default {
name: 'PageTitle',
props: {
title: String,
description: String,
+ logo: String,
},
}; Then you can use that prop within the component. Note the <img v-if="logo" :src="logo" class="my-logo" /> Now all you need to do is to pass that logo prop to the PageTitle component within <PageTitle
v-if="titleVisible"
:title="pageInfo.title"
:description="pageInfo.description"
+ :logo="pageInfo.logo"
/> If you were to submit this as a PR, you'd also need to add your new attribute into the schema ( This would be a really good task for a first PR, if you'd like to add it. Or I can implement it now, as it will be pretty quick, and I think it's a really good idea of yours :) |
Beta Was this translation helpful? Give feedback.
-
Implemented in PR: #105 😄 Once it's merged, which I will do when the build finished, then you can update (to version In my dashboard, it looks like this Hope this helps :) |
Beta Was this translation helpful? Give feedback.
Implemented in PR: #105 😄
Once it's merged, which I will do when the build finished, then you can update (to version
1.4.5
), and use it.Then you just need to add a
logo
attribute underpageInfo
. This should be the path to your image, either local (if it's stored in ./public), or remote as the URL to anywhere if it's on a CDN.In my dashboard, it looks like this
Hope this helps :)