{ Vue JS snippets }

Andrew Schmelyun

Andrew Schmelyun @aschmelyun

Global variables across your entire Vue app w/o importing a config into each component is easy with webpack's DefinePlugin! (This is setup w/ Laravel's mix compiler, but works with vanilla webpack) https://t.co/Q7Feh99sQU

Adam Wathan

Adam Wathan @adamwathan

🔥 When working with JS transition hooks in @vuejs, consider creating dedicated transition components with tailored APIs. It makes your JS-based transitions super easy to reuse and avoids cluttering the parent component with a bunch of transition-specific methods 👍🏻 https://t.co/ov4ljXe3LD

Adam Wathan

Adam Wathan @adamwathan

🔥 Instead of naming your Vue transitions, try combining the default `v-{enter/leave}` classes with separate classes for each enter and leave style. It's much easier to compose different enter/leave transitions on the fly without a new class for every combination 👍🏻 https://t.co/097FSL4ZYh

Philipp Kühn 🤦🏻‍♂️

Philipp Kühn 🤦🏻‍♂️ @_philippkuehn

@adamwathan funfact: you can also use collect() to pass data to vue. a bit shorter 👌 <user-profile :user="{{ collect($user) }}"></user-profile>

Adam Wathan

Adam Wathan @adamwathan

🔥 If you ever seed your Vue components with JSON data in your Blade templates, you *definitely* want to enable double-encoding. Without it, a rogue "&quot;" in any user-submitted data might blow up your front end! https://t.co/kifQ3ksv6H