VueJS cheat sheet
11–13 of 13 posts
Re: VueJS cheat sheet
#12Earlier quoted context omitted.
I'm having a hard time wrapping my head around the problem. Could you elaborate with some examples of how it looks before and afterwards? Wondering whether I'm doing this stuff for my own projects.
I put all the code in a single gist to make it easier to reason. This example (b/c it's basic) looks like more-code that's just generally unnecessary. In practice though, I've found those-sub components, even when it's just a button, tend to benefit from splitting out. You end up doing some styling to them, having them inherit from a parent button component, etc. https://gist.github.com/wjossey/0d7ca1a3c2040e1c376a91…
Re: VueJS cheat sheet
#13Earlier quoted context omitted.
I put all the code in a single gist to make it easier to reason. This example (b/c it's basic) looks like more-code that's just generally unnecessary. In practice though, I've found those-sub components, even when it's just a button, tend to benefit from splitting out. You end up doing some styling to them, having them inherit from a parent button component, etc. https://gist.github.com/wjossey/0d7ca1a3c2040e1c376a91…
Thanks, I haven't realized I could pass a method to a child, which acts on the context of the parent (that's what's happening here, right?).
If you ever did traditiona JavaScript programming earlier in this century, you’ll be familiar with this pattern which is referred to as “callback hell” by some.
If you ever go to use a third party library like Vuetify, the components you use in essence follow the same pattern.