Load your Vue.js javascript and css files conditionally based on the page being viewed. When we enqueue a script or style in WordPress, they are loaded on every page by default. This is not good because we are loading javascript and styles on pages where they are not always used. This means the load times of our pages are longer than they should be. One way to resolve this problem is by only loading the scripts and stylesheets that we want on particular pages.
This can be achieved for our Vue.js javascript and css files by wrapping our wp_enqueue_script and wp_enqueue_style functions in an if statement. This if statement can say, if a certain page is being viewed then enqueue the Vue script and styles, else don't.
By doing this we can speed up our WordPress website.
My Hosting Provider - use code GOBLIN for a discount. Free trial with no card required:
[ Ссылка ]
Ещё видео!