vue-navigation-bar
vue-navigation-bar copied to clipboard
External Links
Can I point the brand-image to an external url? If so, any guidance here?
By the way, so far this is one of the most vue libs that has helped me save some time and effort.
Hey there - glad the library helps.
For the brandImage
pointing to an external URL - you'll want to use the brandImagePath
. The thing is - the usage depends on whether you have isUsingVueRouter
set to true
or false
.
If you are not using VueRouter - then just put a string there for the brandImagePath
value:
brandImagePath: 'https://www.johndatserakis.com'
That will work out of the box.
If you are using VueRouter - things get a bit more tricky, as the brand image is kinda tailor-made to work with the router at that point. I think there's some coding improvements to be done there. I'll assign this to myself and I'll get to it when I can.
For now, you can set:
brandImagePath: '#'
And then listen for the click event:
methods: {
vnbItemClicked(value) {
if (value === 'brand-image') {
// Put your link here
window.location.href = "https://www.johndatserakis.com";
}
},
},
Sorry it's a bit hacky, but it'll work for now.