The Delightful World of Vue
Dive into Vue.js! Master API integration, work with components, conquer the special `v-STUFF`, and organize files with Webpack alias.
About this course
Ready to build an interactive frontend that you'll love! Look no further than Vue.js: a leader on the frontend world and one that you can sink your teeth into, even if JavaScript isn't your main gig. In this tutorial, we'll build a real-world "Products" area for our site using an API-Platform-powered API. Will it be a single-page application (SPA)? Nope! Not in this tutorial - because it turns out, integrating Vue into a "traditional" web app is actually a bit trickier:
Tip
Bonus! Along the way, we'll highlight the few differences needed to make this tutorial work with Vue 3.
- Installing & Setting up Vue with Encore (including a nice
eslint
setup!) - All about the Vue object: let's make it feel boring!
- Single file Components (SFCs)
- Modular styles
- Props, data & state! Ya know, the key to everything
v-bind
,v-text
,v-on
,v-for
,v-show
: basically all the specialv-STUFF
!- Communication up the tree with
$emit
- Making (and organizing) AJAX calls
- Organizing your files & adding Webpack "alias" shortcuts
- methods, computed properties
v-model
(what it really does)- Server-side searching and filtering
- Passing data directly from your server to Vue via Twig
- Watchers: what, when and when not
By the end of this tutorial, you'll feel comfortable - dare I say confident - in all the Vue basics!
Next courses in the JavaScript Frameworks & Tools: Vue section of the JavaScript Frameworks & Tools Track!
20 Comments
For those of you who do the tutorial with NodeJS v17+, adjust the scripts section of your package.json.
Some algorithms or key sizes used in this tutorial are no longer allowed by default with OpenSSL 3.0
`
"watch": "SET NODE_OPTIONS=--openssl-legacy-provider && encore dev --watch",
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && encore production --progress",
`
Hello ! I'm using PhpStorm to, but for webpack encore alias, there is no auto-completion for my javascript files (when we import some file using our alias). Maybe is there a configuration to set in PhpStorm to enable it ?
EDIT : Got it ! After searchs, it's in Settings > Javascript > Webpack > automatic.
Works very good <3 <3
Really nice introduction to the framework with a huge amount of best practices in details. Thank you.
The only thing you haven't mentioned is using vue outside symfony. Yep, I know it's symfonycasts.com website but sometimes (When should I do that? Should I?) even the initial symfony project is splitted into two "pure symfony API" and "pure SPA frontend" repos which are kind of independent therefore encore can't be used and at least that global categoryId variable should be somehow got in another way (from router?), not from twig template. Hope it will be covered in the second part of the course.
@weaverryan @shadowcplays
Why this does not cover the FORMS ? There is big hole between API Platform and Symfony Forms extension....
I saw many posts on the internet when nobody has normal process how to implement Form via API to javascript page like Vue, React or Angular. And the forms are the core part of many pages and if you create with symfony API-platform the separate front and back, you will hit the forms as wtf how to continue and get data from js forms to symfony by secure way.
This was the first reason why i abandoned the symfony framework on beginning because i stacked with my first easy 5 page site, where were 3 simple forms.. and it seems (on forums) like very difficult to do this if your front end is clear js framework which fetch and send data by API and js framework is not integrated via webpack...
Hi Mikolaj!
We will cover forms in part 2 of this Tutorial. So stay tuned for it!
We're on it! We release one new and exciting chapter every day from Monday to Friday
Cheers!
I'll buy access for this tutorial. Do you've an estimative when will be available completely?
Hey Delrei
This course it's been actively released, what it means that we deliver one new chapter every day (Monday to Friday). There're 20 chapters left so I would say it will be fully released in one month
Hi Wilco!
I'm glad you're liking this tutorial! We're releasing about 1 chapter a day with our current schedule (we try to release a group of Chapters near the start of each week)!
If you click on "Next Chapter" on the last recorded one, you might also get a sneak peak of what the next unreleased chapter will be (but no video)!
It will be :). MPA's (multi page apps) - traditional apps that have Vue embedded into parts of them are actually trickier in my opinion than an SPA. We wanted to show that.
If anyone has problems with composer install, because of doctrines ArrayCache -> set "doctrine/orm" to "2.8.5" or less in composer.json