diff --git a/src/api/options-assets.md b/src/api/options-assets.md index 06b1364b62..3c43d59904 100644 --- a/src/api/options-assets.md +++ b/src/api/options-assets.md @@ -8,6 +8,22 @@ A hash of directives to be made available to the Vue instance. +- **Usage:** + ```js + const app = Vue.createApp({}) + + app.component('focused-input', { + directives: { + focus: { + mounted(el) { + el.focus() + } + } + }, + template: `` + }) + ``` + - **See also:** [Custom Directives](../guide/custom-directive.html) ## components @@ -18,4 +34,18 @@ A hash of components to be made available to the Vue instance. +- **Usage:** + ```js + const Foo = { + template: `