ktquez / vue-head

Manager the meta information of the head tag, a simple and easy way
MIT License
984 stars 73 forks source link

Setting a dynamic title seems a bit too literal #65

Closed mikeskiddle closed 6 years ago

mikeskiddle commented 6 years ago

Hi

Apologies if this has been asked before, or is a simple mistake on my part.

I'm trying to set the title attribute grabbing a data object, however the title attribute is outputting the actual function. For example, my code is:

head: { title: function() { return { inner: this.workItem.title, }; }, }

However, the title is being output as:

<title data-n-head="true">function () { return { inner: this.workItem.title }; }</title>

Now, not sure if it makes a difference, but when the page loads, the workItem object is empty, it gets populated via an AJAX call using vue routers beforeRouteEnter call.

Any help or guidance would be much appreciated

ktquez commented 6 years ago

@mikeskiddle You are using vue-meta or vue-head?

mikeskiddle commented 6 years ago

Hi

Thanks for the reply

I was under the impression that it was vue-head that I was using (I'm building the site with nuxt) however after a bit of digging it's quite possibly vue-meta that is being used.

if this is the case, then please take this post down to prevent me looking amazingly stupid 🙃

mikeskiddle commented 6 years ago

Closing this as I've stupidly jumped to the forum before fully investigating the documentation.

thanks again

ktquez commented 6 years ago

@mikeskiddle This is normal, good thing that solved.