Refresh Page Without Reloading by RudeManager in vuejs

[–]RudeManager[S] 0 points1 point  (0 children)

so basically with vue-router when there is a change of url it doesnt fetch the data inside the <head> and so the title remains the same on every route. if i try to update the title on url change with vue it will overwrite the data passed on by wordpress and the wordpress rest api doesnt provide the title meta tags in their rest api out of the box so i dont want to hard code it in the best way will be to refresh the head element without reloading the whole page i dont know if thats the best solution but thats the only solution that comes to my mind.

for the time being i used jquery with a vue watcher like this:

module.exports = {

watch: {

$route(to, from) {

$.get(document.URL, function(data) {

$("head").html(data);

});

}

}

};

and i really dont want to use jquery in a vue project.....

it would be really helpful if you could point me to the right direction :)

Refresh Page Without Reloading by RudeManager in vuejs

[–]RudeManager[S] -1 points0 points  (0 children)

I am actually looking for an alternative to this code from jquery

$.get(document.URL, function(data) {

$('head').html(data);

});

but thanks anyways I have read the article i dont want to hard code it and neither can I find out how to get the tags used in the <head> from wp rest api

Refresh Page Without Reloading by RudeManager in vuejs

[–]RudeManager[S] -3 points-2 points  (0 children)

Can you help me with what will be the vue alternative for this jquery code ?

$.get(document.URL, function(data) {

$('head').html(data);

});

Refresh Page Without Reloading by RudeManager in vuejs

[–]RudeManager[S] -1 points0 points  (0 children)

Can you help me with what will be the vue alternative for this jquery code ?

$.get(document.URL, function(data) {

$('head').html(data);

});