Giter Club home page Giter Club logo

vuejs-wordpress-theme-starter's Introduction

image

Tweet Twitter Follow

VueWordPress Theme Starter

A true WordPress theme with the guts ripped out and replaced with Vue. Looking to create a Vue-powered WordPress plugin? I've got a starter for that too!

Who's this for? When I started diving into using Vue in WordPress I found plenty of great starters for headless WordPress, but I had the added constraint of needing to run the front and backend on the same host, thus this project was created.

Need help? Join the VueWordPress Slack.

Features

  • Tailwind is built in! If you don't want Tailwindcss in your project you can easily disable it by removing the import statement in styles.css.
  • Hot reloading/browsersync for local development.
  • VueRouter integrated
  • Vuex integrated (with sample WordPress-centric modules)
  • Axios for API requests
  • Follows the development guidelines/structure set forth by Vuejs
  • Bare essentials needed for a functional WordPress theme
  • All requests are redirected back to the index.php so your Vue routing is respected.
  • PostCSS baby

Getting started

Watch the getting started video

  1. Clone the repo inside of your wp-content/themes/ directory
  2. Navigate to the theme directory in your terminal and run npm install npm run watch for development npm run build when you're ready to deploy the theme.
  3. Activate the theme in your WordPress instance.
  4. Update your permalink settings (Settings -> Permalinks) to be "Day and name". If you don't want to use this setting you'll need to update the Vue router so it can find your content correctly. Please note that if you want to use a different permalink structure you'll need to update ./src/router/index.js so it looks for the correct path.
  5. Boom.com!

Since by default Tailwind completely resets all styles/spacing, there are a few initial styles I've provided in src/assets/css/_tailwind.css to make things appear more like you'd expect. Modify to your liking!

Video Training

Code Organization

All of the code you're going to edit is located in /src/. From there it's broken into a few logical directories.

  • /src
    • /api for API requests
    • /assets for images mostly
    • /components Vue components
    • /router vue-router directives
    • /store vuex store and modules
    • /assets/css CSS styles
    • /vendor 3rd party scripts and libraries

All scripts and styles in /src are compiled down to the /dist directory, which is what you will deploy. When you're ready to deploy don't deploy the src/ directory.

New to Vue?

Not sure where to begin? The Vuejs documentation is actually amazing, but if you're looking for video training I highly recommend the free Learn Vue 2: Step By Step course over at Laracasts. There's also a great playlist by Academind available on YouTube that covers pretty much everything you'd want to know about building a fully-featured Vue app.

I've created a couple of example components in src/components/widgets to give you an idea of how to work with the Vuex store data.

If you're new to Vue/Vuex I would do the following:

  • Open up src/app.js this is the main JS file for the app and will give you a glimpse into what's going on behind the scenes.
  • Next open up src/App.vue this is the primary app component, a page wrapper of sorts. It contains the header/footer and the <router-view> component which is what loads in all of the other screens as you navigate around the app. Note that by default src/components/Home.vue is loaded into the router-view initially.
  • Next open up src/routes/index.js and notice how the routes are setup by default. Out of the box there is only one route, the / or home view. For more information on setting up routing within your app checkout Vue-Router.
  • Next is the Vuex store. I won't cover how that works here as it's a tiny bit more advanced. Check out all files in src/store and start to familiarize yourself with what's going on. It's based on the official Vuex example project setup and uses Vuex modules. By default I've included a couple of modules I thought you might need.

The first thing you're probably going to want to do is start editing and components in src/components/.

External References

Features coming soon:

  • More documentation

Changelog

2020-01-29

  • Removed some legacy CSS, further integrated Tailwind.
  • Added browser-sync!
  • Reorganized and updated the webpack config and files.
  • Updated many npm packages including webpack
  • Updated webpack production minification/optimization settings.

2020-01-28

  • Updated npm packages
  • New theme screenshot
  • Updated README
  • Updated Home component

2020-01-28

  • Added tailwindcss support.
  • npm module updates
  • updated to latest version of Vuejs

2019-02-05 Added

  • Support for postcss
  • New css style examples
  • Cache busters for js and css

Changed

  • Updated outdated npm packages
  • Recent post and Page widgets to use router-link
  • Removed Laravel Mix and replaced with standard webpack config

Removed

  • Example Firebase integration
  • jQuery
  • Several unused npm dependencies
  • Bootstrap / Bootstrap Vue
  • Several variables that were stored on the window object
  • Support for sass styling (switched to postcss)

2018-08-20 Added

  • Default routing for posts and pages. @EvanAgee
  • Views for posts and pages. @EvanAgee
  • getters for pages. @EvanAgee
  • Examples for fetching pages/posts with either Vuex actions OR in component. @EvanAgee
  • Activated LocalStorage plugin in store. @EvanAgee
  • Loader component. @EvanAgee

Removed

  • UglifyJS. @EvanAgee

2017-10-24 Added

  • status_header(200) to keep Wordpress from returning 404 for vue-router paths.

2017-10-21 Removed

  • vue-slick dependency
  • vue2-google-maps dependency
  • unnecessary header/footer php files
  • the-tailor dependency
  • font-awesome dependency

Changed

  • Updated webpack (Larevel Mix) config
  • Switched from Bootstrap to Bootstrap-Vue

Fixed

  • Fixed index.php

2017-10-17 Added

  • More documnentation. @EvanAgee
  • Post module. @EvanAgee
  • A few code comments. @EvanAgee
  • Example widgets for posts and pages. @EvanAgee

Changed

  • Home page to display the posts and pages widgets. @EvanAgee

2017-10-11 Initial commit

vuejs-wordpress-theme-starter's People

Contributors

dependabot[bot] avatar evanagee avatar gradedcatfood avatar nattatorn-dev avatar ramiy avatar simplenotezy avatar tes3awy avatar wester97 avatar wvffle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuejs-wordpress-theme-starter's Issues

Error

In my build I'm getting the following TypeError error: "t.all.filter is not a function"

404 on the api

Hey,

So ive just downloaded the latest WP (4.9.5) and installed your theme, ran NPM install and npm run production.

Theme is working however i get 404 on all the api requests to wp-json/wp/v2/

I then changed it to ?rest_route=/wp/v2/ in app.js ( If i put that into the browser it returns JSON )

Unfortunately im still getting the same issue.

Am i missing something or is this due to a later version of WP?

Thanks

Wordpress web push notifications

i'm using onesignal to push web notifications so how could i achieve that via vuejs as frontend i have looking over the web for web push api i have found this https://codecanyon.net/item/desktop-mobile-push-notification-system-wordpress-plugin/6548533 but to make it works i have to get this plugin first https://codecanyon.net/item/smio-wordpress-api-complete-solution/6448487 so are those plugins will works fine with wordpress and vuejs as frontend or do u suggest a solutions

SEO impact?

Hi,

This looks great! Can't wait to try it out. Just wondering about SEO though. If we installed Yoast SEO for instance would this be enough as I assume the meta tags it adds to the head would still work as normal if every URL loads the index.php?

Correct way to get single post/page from API?

Hi there,

I've got this theme installed and so far, most things are making sense. What I can't figure out is how to use the bundled API method getPage() to pass the content to the component. I'd love to see a full example of how this is accomplished. So far, what I've been trying are different combinations of this (screenshot):

https://cloudup.com/cokkIKOWUlk

Any help would be very much appreciated.

Browsersync

Hi !
Thanks for great starter theme!
I'm wondering how can i use browsersync there? I found that laravel-mix support it but I can't make it work...

Firebase version causes grpc clash

package.json defines "firebase": "^4.13.1",
Current version of firebase is 5.6.0

installing with the old version on node v10.14.1 causes issues with the gRCP library.

"TypeError: Cannot read property 'rendered' of undefined"

hello,

i got this error on my console, from fresh install,
Error from RecentPostsWidget..

[Vue warn]: Error in render: "TypeError: Cannot read property 'rendered' of undefined"
found in
---> <RecentPostsWidget> at src/components/widgets/RecentPosts.vue
       <Home> at src/components/Home.vue
         <App> at src/App.vue
           <Root>

any solution?

Thanks.

Replace javascript with typescript

Hey, I'm trying to replace js with ts, but there are no terminal errors and I get a blank page.

What I made:

  1. npm install typescript ts-loader --save-dev

ts-loader version - 3.5.0

  1. changed name from "app.js" to "app.ts"
  • in functions.php
  • in webpack.mix.js
  1. in "webpack.mix.js" added
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: "ts-loader",
          options: { appendTsSuffixTo: [/\.vue$/] },
          exclude: /node_modules/
        }
      ]
    },
    entry: {
      app: "./src/app.ts"
    },
    resolve: {
      extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx"]
    }
  })
  1. added tsconfig.json file to main folder
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": ["webpack-env"],
    "paths": {
      "@/*": ["src/*"]
    },
    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": ["node_modules"]
}
  1. added vue-shim.d.ts file to main folder
declare module "*.vue" {
  import Vue from "vue";
  export default Vue;
}

app.ts and App.vue

import Vue from "vue";

import App from "./App.vue";

new Vue({
  el: "#app",
  render: h => h(App)
});

<template lang="html">
  <div class="">
    asdasdds
  </div>
</template>

<script lang="ts">
export default {
}
</script>

<style lang="css">
</style>

Can you maybe help with this issue?

New updates for 2019!

I've made quite a few updates to the project that should fix many of the issues you all have been experiencing. Some highlights include:

  • Project is updated to work on latest stable version of node and npm.
  • Removed Laravel mix.
  • Removed jQuery
  • Removed Bootstrap Vue
  • npm cleanup/updates

Please note that the paths of the JS and CSS have changed so you may need to update your project.

2019-02-05

Added

  • Support for postcss
  • New css style examples
  • Cache busters for js and css

Changed

  • Updated outdated npm packages
  • Recent post and Page widgets to use router-link
  • Removed Laravel Mix and replaced with standard webpack config

Removed

  • Example Firebase integration
  • jQuery
  • Several unused npm dependencies
  • Bootstrap / Bootstrap Vue
  • Several variables that were stored on the window object
  • Support for sass styling (switched to postcss)

Update package.json

vue => 2.5.17
vue-template-compiler => 2.5.17

After upgrading, I'm getting a bunch of errors. This is one of them:

[Bootstrap-Vue warn]: b-nav: Prop 'is-nav-bar' is deprecated. Please use component '<b-navbar-nav>' instead.

Did a fresh install and got this error:

Vue packages version mismatch:

Preview button?

Sorry for assuringly stupid question but is there any chance this setup allows for a functioning preview button? Or any planned workarounds/integrations?

Thanks!

How do you remove Bootstrap?

Great theme! Just wondering how to extract Bootstrap from the them as I would like to handle the styling myself. Thanks!

How to display single post?

Hi Evan,

I'm trying to display single post, I've created a SinglePost.vue, add object into /router/index.js

{
    // How to dynamic detect the path?
    path: '/:slug',
    component: SinglePost
}

Right now I'm cheating, he he, change the permalink into "postname" only, to make it easy.

My question is, in WP we have many ways to display the path, from date /2017/10/18/hello-world, to category like /cagegory/hello-world, how could we get it and put it into the path programmatically?

Thanks.

npm run production

I got this error below when I try 'npm run production'.

Is it any possibility to run your theme on the local server?
As others mentioned, no page content is loaded.


ValidationError: UglifyJs Plugin Invalid Options

options should be object

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ production: node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

About SEO

Hello,

Can you tell me how my SEO will be affected if I use this starter pack ?

The theme shows up with no page content.

I could use a hint to get this theme working with WordPress.

  • Brand new WordPress setup with no other plugin/themes.
  • Downloaded and extracted vuejs-wordpress-theme-starter Theme in wp-content\themes folder
    -- npm install and npm run production.
    -- Activated the theme in wp-admin

I see header menu 'Link and Disabled' and footer 'This is the footer'.
However, I do not see the page content.

Not sure why I do not see page content. Wordpress is installed in a subdirectory so my wordpress url is http://localhost:8888/mywebsitefoldername

I tried to change API_BASE_PATH to point to /mywebsitefoldername/wp-json/wp/v2/

In Chrome Developer Console, I see http://localhost:8888/mywebsitefoldername/wp-json/wp/v2/pages?per_page=10 returns 200 with data.

Handling assets

Hi @EvanAgee, first, thank you for the work! So far I've made it to good use but I'm wondering about how to handle assets, namely static images that sit in the dist folder.

I do have a solution which works, which is making a global variable to the directory and use it for static images in my template like so:

Vue.prototype.$ASSET_DIR = "/wp-content/themes/theme-name/dist";

and in my template
<img :src=" $ASSET_DIR + '/img/logo.svg'">

However, there must be a better way? Is there an asset handling provided by webpack that I'm missing here?

Routing when in sub-directory

Hi Evan,
first of all thanks for the good work!

I am new to vue so I got a little issue when I try serving the application from a subdirectory.
The home url is http://localhost/projects/fabiangeierblog/.

The header and footer are shown but inside <router-view></router-view> Home.vue is not displayed.

This is my .htaccess File in C:\xampp\htdocs\projects\fabiangeierblog:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projects/fabiangeierblog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /projects/fabiangeierblog/index.php [L]
</IfModule>
# END WordPress

And this is my approach solving the problem in the router/index.js (C:\xampp\htdocs\projects\fabiangeierblog\wp-content\themes\fabiangeierblog)

import Vue from 'vue'
import Router from 'vue-router'

// Components
import Home from '../components/Home'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      // props: { pageContentID: 383 }
    }
  ],
  base: "/projects/fabiangeierblog/",
  mode: 'history',
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  }
})

export default router

Thanks for the help and the good work you are doing.

Fabian

demo?

Is there a demo available to experience the look and feel?

WP Menu via WP-API

Hi! for the menus via WP-API, we can use WP Rest API Menus, but we have a problem. The endpoint don'ts /wp-json/wp/v2/, is /menus/v1/menus.

Possible solution: In the app.js file, change the API_BASE_PATH for only /wp-json, instead of: /wp-json/wp/v2/.

done that, we created a module to get the menu with vuex. ๐Ÿ˜„

I'm using it that way, but with NuxtJS. Can I make a pull request?

Q: what is Bootstrap used for?

Just want to ask if bootstrap is a must dependency? Can it be removed from starter theme? Thank you!
Great work and I really appreciate the effort. Keep up the awesome work...

npm run production error

Hi!
Thank You for your work.
Help solve the problem.
I run 'npm run production' and get the error

Uncaught TypeError: Cannot read property 'call' of undefined
at webpack_require (manifest.js:55)
at Object.eslX (app.js:6)
at webpack_require (manifest.js:55)
at Object.0 (app.js:1)
at webpack_require (manifest.js:55)
at webpackJsonpCallback (manifest.js:26)
at app.js:1

in manifest.js:
// Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, webpack_require);

How I can fix it?

Vue-cli

Hey Evan,

This is a great project, exactly what I've been searching for!

Have you considered creating a repo that's compatible with Vue-cli? It would make it a cinch to bootstrap new projects using this starter theme.

X-CSRF-TOKEN

window.WordPress.csrfToken ?!
window.WordPress is undefined

icons

How do i import icons like font awesome icons for use with this theme?

Integrate Vuetify rather than Bootstrap

Curious if you had any thoughts about replacing Bootstrap with Vuetify. I may be pursuing that path, and was looking at your project to gleen some Vue + WP insight.

Lazy-loading routes, async components

Code splitting minimizes bundle size, so I wanted it for my project. This is how I did it:

in router/index.js:

// import Page from '../components/Page/Page.vue'
const Page = () => import('../components/Page/Page.vue')

in webpack.mix.js:

mix.webpackConfig({
  output: {
    publicPath: 'vuejs-wordpress-theme-starter/dist/',
    chunkFilename: 'scripts/[name].[chunkhash].js',
  },
});

and in the <head> of index.php:

<base href="<?php bloginfo( 'stylesheet_directory' ); ?>" />

Not sure if lazy-loading is 'best practice' for everyone, so putting it here instead of a pr. Perhaps its useful for someone or can be improved.

"SyntaxError: Block-scoped declarations not yet supported outside strict mode"

Hi guys,

So I've downloaded fresh copy of this theme, started as Mr. Readme said, and I ran into this error doing

npm run watch

Installation went well exept for two warnings:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg= integrity checksum failed when using sha1: wanted sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg= but got sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==. (2301 bytes)

npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

Entire error looks like this:

> @ watch /var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

/var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/laravel-mix/setup/webpack.config.js:24
let WebpackConfig = require('../src/builder/WebpackConfig');
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at requireConfig (/var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/webpack/bin/convert-argv.js:97:18)
    at /var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/webpack/bin/convert-argv.js:104:17
    at Array.forEach (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-02-18T13_33_30_936Z-debug.log

.log file says prints the same.

Steps do reproduce this issue:

having ubuntu 14.04
npm 5.6.0
download zip, unpack & run.

Anyone else had this problem?

Create a wordpress theme with VueJS incorporated

Hi,
I am building a custom theme in wordpress php and I would like to incorporate some vue components in it. I would like to keep wordpress' functionnality (login, register, custom post-types etc.) and its core php functions.

Is it possible to use Vue in some sections of some pages only, including the scripts in a php file and make vue run it instead of index.html (default in vue-cli) for example?

Thanks a lot :)

Can't find assets ?

Hi there, i'm trying to add assets (images and videos) directly form the theme but can't find a way to make it work. I tried several things, and feel a bit dumb, but I can't make it work and can't add a single image into theme ! So what is the best and proper way to do it ? (like the image already included in your theme)

common vue.js template

i understand that in router/index.js you can link a wp page by id to a vue component, i have 2 routes set up like this -

  {
      path: '/',
      name: 'Home',
      component: Home,
      // props: { pageContentID: 383 }
  },
  {
      path: '/about',
      name: 'About',
      component: About,
      props: { pageContentID: 16 }
  }

and my-url.local/about works fine

however when a wordpress administrator is adding new pages there is no fallback templates, in regular wordpress those would be page.php, post.php etc.

how can I add these fallback view templates or are they already there and I haven't found them yet?

npm install returns a list of errors

Hi Evan,

I'm having trouble getting your theme up and running. I installed Wordpress on a local (MAMP) server and simply copied the theme files to my theme directory and took things from there. Following the quickstart video and the readme file I tried running npm install inside the theme directory. This in turn just gave me a bunch of errors right off the bat. What could I be doing wrong?

assets not rebuilding with npm run watch

Just noticing this but it seems like when files are changed witin the VueJS source code the project isn't recompiling. I keep saving and don't see the terminal re-run webpack processes or anything. Also having issues seeing changes on the theme once its activated as a theme on a wordpress install. Is their something i'm missing?

Assets URL rendering problem

before mixing all the assets i used to put all images under src/assets/images/, after mixing all the images copied to dist/assets/, but wordpress theme could't get this image from its url i.e <img data-v-10e39ae0 src="/images/homelayer1-min.png?29a6a2fd8dadbdd1e9cd6b82fe8f22d5">.

the url should be <img data-v-10e39ae0 src="dist/assets/images/homelayer1-min.png?29a6a2fd8dadbdd1e9cd6b82fe8f22d5">

now how to resolve this image url problem?

Is this compatible with Carbon fields?

https://carbonfields.net

It's awesome library you can easily add custom fields as gallery, nested list, widget, gutenberg block, etc.
Basically you add something in function.php then pass a variable into any wordpress page template.... but how do you store php variables into vue.js data?

In that case it's a php code carbon_get_theme_option( 'crb_myName_field' );

Firefox rendering

Hi there,

While the page loads nicely in e.g. Opera and Safari, it looks really bad in Firefox for the first second (on a slower connection) while the page is loading.
vuejs-wordpress_firefox-rendering

Also, the Youtube video container has a scrollbar, which looks strange, especially just before the video has been setup. Interestingly enough this is not the case with active RDM.
vuejs-wordpress_firefox-rendering_overlay

Body Not Rendering

On OSX, I have loaded the starter into a MAMP [v4.2.1 (852)] instance. I have run 'npm run watch' and also 'npm run production'. In both cases, the 'header' and 'footer' render, but the body does not. Suggestions? I have fixed a minor issue with the API route (I was getting 404 errors, but I fixed this with a small edit to the app.js (I removed the leading '/'). Calling the api directly from the browser URL works fine (in my case it is 'http://localhost:8888/development-vue/wp-json/wp/v2/categories?sort=name&hide_empty=true&per_page=50').

npm run watch issue

I'm running npm run watch but I can't find where is the application running.
I tried localhost:8080 without success...
A laravel mix notification pops up but I don't know on which port the site it running.
Laravel is new to me and it looks a bit confusing....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.