WP Manifestindependent plugin directory
manifest / developer / wp-api-vuejs-poc

WP API Vue.js Proof of Concept

Proof of concept WordPress plugin to submit posts from the front end using the WordPress REST API and Vue.js

by Jim Frenette · github.com/jimfrenette/wp-api-vuejs-poc · website

19stars
5forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/jimfrenette/wp-api-vuejs-poc/archive/refs/heads/master.zip

Proof of concept WordPress plugin to submit posts from the front end using the WordPress REST API and Vue.js

http://jimfrenette.com/2017/01/post-from-front-end-wp-api-vuejs-part2/

https://www.youtube.com/watch?v=aRHX-Xpy67E&t


API Request Handlers

Three different web request handler examples are included:

jquery

The jquery-p02 tag contains the following additions:

  • List posts submitted by the current user
  • Select from the list to edit a post
  • Delete a post from the list

The jquery-p01 tag was cut from master and updated to replace vue-resource with the ajax method available in the external jQuery library loaded by default in WordPress.

axios

The axios-p01 tag was cut from master and updated with axios and vue-axios to replace vue-resource.

vue-resource

The vue-resource-p01 tag was the initial version, created in master using the vue-resource plugin for Vue.js to provide services for making web requests and handle responses using a XMLHttpRequest.



webpack

Build Setup

# install dependencies
npm install

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.