vuejs-wordpress-plugin-starter
vuejs-wordpress-plugin-starter copied to clipboard
A quick way to get up and running with a Vue-based WordPress plugin

vuejs-wordpress-plugin-starter
- Browsersync for auto refreshing during local development
- webpack to handle all of the assets
Getting Started
- Clone the repo inside of your
wp-content/pluginsdirectory - Rename the cloned plugin directory,
vwp-plugin.phpand the files inside of theinc/directory to suite your needs. - Review the contents of vwp-plugin.php making sure to replace any occurances of
vwp-plugin,vwp_pluginandVwpPluginwith your own namespacing. - Navigate to the plugin's directory and run
npm installnpm run watchfor developmentnpm run buildwhen you're ready to deploy the plugin. - Note
templates/admin/index.phpis the base PHP template for the plugin settings UI. It has an element<div id="vwp-plugin"></div>where the Vue app is getting mounted. - The provided Vue template can be found in
src/vue/App.vue. - Activate the plugin in WordPress
- Get to work!