vue is a popular front-end framework used widely for different projects. You can also use vue in WordPress to simplify and standardize your frontend development taks. In this article i’ll cover how to load vue in WordPress topic.
I’ve recently released a plugin to load vue in WordPress. You can find the link in the end of the article.
Vue with WordPress
In most cases, template developers develop their own Javascript library. When you need to extends a theme’s capabilities either you need support from original developer, or you need non-minimized version of template’s javascript. And everyone offeres a unique way of dealing things.
Modern frontend frameworks can be used to standardize it. vue is very easy to learn, instead of other frontend frameworks. I believe using vue with WordPress can be a solution to most of the frontend issues.
How to Load vue in WordPress
When it comes to WordPress you can think like there are two types of pages, admin pages and regular pages. For each of those, you need to tell WordPress to load your scripts and styles separately.
As a developer, in both admin_menu and wp_enqueue_scripts hook you need to enqueue you scripts.
Plugin to Load vue in WordPress
Today, i’ve released a plugin to load vue in WordPress automatically. (Automatically loads latest version.)
You can download it from https://github.com/yigitozdemir/wp-vue
Do you have experience with using vue with WordPress? Or questions? Please leave a comment below.