goatshark
3 years ago
34
2
Vue

More Vue, less Blade

Posted 3 years ago by goatshark

Greetings. Just wanted to open up a conversation about some struggles I have been having learning to use Vuejs. Some background:

  • Thanks in no small part to Laracasts, I have been learning Vuejs.
  • I know no other javascript frameworks.
  • I don't have much experience at all with javascript of any flavor.
  • I use vue-resource to interact with my API.
  • I think javascript sucks to learn, but now I'm hooked on the Vuejs crack pipe and every time I start putting together a page layout Vuejs seems like a hammer and all I can see are nails.

I often traversed my model relationships with Blade. I didn't realize how nice that was until I started using Vue and only have available the information that my API provided as a response. If I didn't deliver the related data from my API, my front end can't just magically go get it for me like Blade would. That totally makes sense. (If my understanding of this is off, please correct me!)

I've started to use protected $with = ['related_table']; way more often now. That seems to bridge the gap. My questions are:

  1. Is the (over) use of protected $with a good practice?
  2. In your experience, has the use of protected $with ever bitten you?
  3. Is this a typical growing pain when moving from strictly using Blade to trying to use more Vue (or ajax generically)?
  4. Do my questions suggest that I'm missing part of the picture? And if so, can you suggest some topics that I should go learn more about?

Thanks!

Please sign in or create an account to participate in this conversation.