YUNOVA · Vue.js
Module 11: Advanced Vue
Custom directives in Vue
Key points
- A custom directive adds low-level DOM behaviour, like v-focus.
- Hooks such as mounted and updated run at element lifecycle points.
- Prefer components for most reuse; use directives for direct DOM work.
Render functions and JSX in Vue
Key points
- Render functions build the view in JavaScript with h().
- JSX is an alternative syntax for render functions.
- They help when templates are too rigid for dynamic output.
Vue reactivity internals
Key points
- Vue 3 uses JavaScript Proxies to track reads and writes.
- Effects that read reactive data re-run when that data changes.
- ref wraps single values and reactive wraps objects.
Building a Vue plugin
Key points
- A plugin is an object with an install(app, options) function.
- It can add global components, directives or provide values.
- Register it with app.use(plugin).