All Projects → 0aveRyan → wordpress-day-spa

0aveRyan / wordpress-day-spa

Licence: GPL-2.0 License
Example Vue.js-powered SPA running in the WordPress Admin with vue-router and vue-loader

Programming Languages

Vue
7211 projects
PHP
23972 projects - #3 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to wordpress-day-spa

Vue Soundcloud
🎧 A SoundCloud client built with Vue and Nuxt
Stars: ✭ 141 (+683.33%)
Mutual labels:  spa, vue-router
Redux Framework
Redux is a simple, truly extensible options framework for WordPress themes and plugins!
Stars: ✭ 1,602 (+8800%)
Mutual labels:  wordpress-plugin, wordpress-admin
Vue Stack 2.0
Vue 2.0 Project Boilerplate
Stars: ✭ 166 (+822.22%)
Mutual labels:  spa, vue-router
Vue Laravel Spa
Single Page Application made with Vue.JS2, Vue Router, Vuex and Laravel 5.6.
Stars: ✭ 107 (+494.44%)
Mutual labels:  spa, vue-router
wp-rest-api-filter-items
A WordPress plugin that filters WP REST API items to your requirement.
Stars: ✭ 61 (+238.89%)
Mutual labels:  wordpress-plugin, wp-api
Vue Spa Project
vue.js + vuex + vue-router + fetch + element-ui + es6 + webpack + mock 纯前端SPA项目开发实践
Stars: ✭ 118 (+555.56%)
Mutual labels:  spa, vue-router
Mmf Blog Vue2
mmf-blog vue2.0 (vue2, vue-router, vuex)
Stars: ✭ 232 (+1188.89%)
Mutual labels:  spa, vue-router
Vue axios spa
基于vue2+axios+vux+vue-router+vuex构建的单页微信端项目
Stars: ✭ 54 (+200%)
Mutual labels:  spa, vue-router
vue-seo-friendly-spa-template
Vue.js PWA/SPA template initially scaffolded with vue-cli and configured for SEO. Makes use of prerendering and other techniques/packages in order to achieve a perfect "Lighthouse Score".
Stars: ✭ 41 (+127.78%)
Mutual labels:  spa, vue-router
Laravel-Vue-SPA-template
Template for Single Page Applications built with Laravel and Vue.
Stars: ✭ 22 (+22.22%)
Mutual labels:  spa, vue-router
Vuejs Wordpress Theme Starter
A WordPress theme with the guts ripped out and replaced with Vue.
Stars: ✭ 1,359 (+7450%)
Mutual labels:  spa, vue-router
wordpress
Free PWA & SPA for Wordpress & Woocommerce
Stars: ✭ 103 (+472.22%)
Mutual labels:  wordpress-plugin, spa
Running Time
Sample Single Page Application using Laravel & Vue.js + Vuex + Vue-Router
Stars: ✭ 90 (+400%)
Mutual labels:  spa, vue-router
Todolist Frontend Vuejs
Front-end application for Todolist Web application built with Laravel and Vue.js
Stars: ✭ 120 (+566.67%)
Mutual labels:  spa, vue-router
Cloudbookmark Spa
基于iView开发的云书签SPA应用
Stars: ✭ 88 (+388.89%)
Mutual labels:  spa, vue-router
Symfony Vuejs
Source code of the tutorial "Building a single-page application with Symfony 4 and Vue.js"
Stars: ✭ 170 (+844.44%)
Mutual labels:  spa, vue-router
Vue Spa
vue-spa : vue + vue-router + axios + vuex + vux 快速成型移动端项目,直接使用。欢迎star
Stars: ✭ 46 (+155.56%)
Mutual labels:  spa, vue-router
Laravel Vuejs.com
Laravel and VueJs Blog, using Laravel nova, GraphQL, NuxtJs, Apollo and ...more
Stars: ✭ 54 (+200%)
Mutual labels:  spa, vue-router
Vue Wp Starter
A WordPress Vue.js starter plugin
Stars: ✭ 214 (+1088.89%)
Mutual labels:  wordpress-plugin, vue-router
patterns
Pattern Library for WordPress Theme and Plugin Developers to aide in building Admin interfaces
Stars: ✭ 56 (+211.11%)
Mutual labels:  wordpress-plugin, wordpress-admin

wordpress-day-spa

Example of a Vue.js-powered SPA running in the WordPress Admin with vue-router and vue-loader.

screenshot of spa in action

project structure

  • package.json - defines dependencies

  • webpack.config.js - defines codesplitting and compile processes

  • app/src/wds.core.js - main app scaffolding with dependency-injection, component registration, route config and script that mounts the app.

  • app/src/WDS.vue - main app template injected onto page containing the <router-link> and <router-view> components.

  • app/assets/js/wds.app.bundle.js - main bundle containing CSS, JS and HTML to render

  • app/assets/js/wds.lib.bundle.js - main bundle containing vue, vue-router, axios and other libraries.

  • app/admin/class-spa.php registers the dashboard page with wordpress, enqueues bundles and contains the HTML markup used by the app to mount.

using the project

  • npm install to bring down dependencies

  • npm run dev to generate the bundles plus watch files and recompile on change

  • npm run build to generate small, minified production assets

how it works

  1. Work on your SPA in app/src.
  2. Execute npm run dev to use webpack to watch those files for changes and place compiled bundles in app/assets/js.
  3. vue-loader and babel help webpack translate the Single Component .vue files into native JavaScript that builds DOM nodes, contains script and CSS all in a unified file (webpack can be used to split all CSS into a single file as well).
  4. When the dashboard page is loaded, the bundles containing libraries and the app itself are enqueued and the app script is "localized" with a WP-API nonce and other supporting metadata.
  5. The app latches onto the <div id="app"></div> and Vue renders the application. vue-router by default uses hash navigation, which can be used to launch directly into a screen within the app.

example wp-api call

spa dependency injection

babel and vue-loader allow us to use import and export within our .vue files to handle dependencies.

All third-party dependencies and custom components are managed in the app/src/wds.core.js file.

Adding a new component

  1. Create your new .vue file with a <template type="text/babel"></template> and a <script type="text/babel"></script>
  2. In the <script> definition, import Vue from from our wds.core.js file in the component. This makes all other dependencies available.
  3. In the <script> definition, export with a new component definition. Example.
  4. import YourNewComponent from the location in your directory in the wds.core.js file.
  5. Set a Vue.component( 'your-component-elem', YourNewComponent )

Recommended Reading

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].