The key is to make sure everything is loaded so it can work.
That means:
Vue is loaded so your app will work.
The Dom element is loaded so your app can attach to it
The app is loaded so it works.
Generally in Wordpress, scripts are loaded in the head, before the Dom.
This is ok for loading Vue, because it doesn't need the Dom.
However, the app should be loaded after the Dom, so it's best to put it in the footer.
That means if you are loading the two together as one package, put that in the footer since it needs the Dom.
Does that make sense?
Yep makes sense, turns out it was my webpack config, I opted to use laravel mix instead and problem solved! Thanks for the article.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The key is to make sure everything is loaded so it can work.
That means:
Vue is loaded so your app will work.
The Dom element is loaded so your app can attach to it
The app is loaded so it works.
Generally in Wordpress, scripts are loaded in the head, before the Dom.
This is ok for loading Vue, because it doesn't need the Dom.
However, the app should be loaded after the Dom, so it's best to put it in the footer.
That means if you are loading the two together as one package, put that in the footer since it needs the Dom.
Does that make sense?
Yep makes sense, turns out it was my webpack config, I opted to use laravel mix instead and problem solved! Thanks for the article.