DEV Community

Discussion on: Vue Application as a Wordpress Plugin

Collapse
 
oivinds profile image
oivinds • Edited

Hi, and thanks for this article!
I have a problem making it work though. The Vue example app will not display on the page. This is what I got:

  • chunk-vendors.js and app.js are loaded on the same page along with the shortcode generated div (#app). As confirmed by browser network tab and elements tab.

  • I have tested with yarn serve that a dev server version works and displays the application.

Any hints to what I am missing?

Edit: Now it works!
I had to add DomContentLoaded listener to delay the Vue instantiation in main.js. Without it it will not work for me with what is provided in this tutorial. I'd be happy to get a comment telling me I am wrong and why.

Collapse
 
dgmann profile image
DGMANN • Edited

Hey oivinds!

sorry for my late response and i'm happy to hear that you get it working now.
It is a bit difficult for me to debug this one but is it working with a new and clean wordpress installation?