From 5d3ac137e589bc5a4d2f62fd0f428ce73ec79d86 Mon Sep 17 00:00:00 2001 From: Stanislav Lashmanov Date: Mon, 20 Jul 2020 16:16:46 +0300 Subject: [PATCH 1/3] Add usage examples for Asset Options --- src/api/options-assets.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/api/options-assets.md b/src/api/options-assets.md index 06b1364b62..361c530ec7 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: `
Foo
` + } + + const App = Vue.createApp({ + components: { + Foo + }, + template: `` + }) + ``` + - **See also:** [Components](../guide/component-basics.html) From 2780450c9562eeef3ac122cde5adfa302399f25b Mon Sep 17 00:00:00 2001 From: Stanislav Lashmanov Date: Mon, 20 Jul 2020 16:25:34 +0300 Subject: [PATCH 2/3] Update src/api/options-assets.md Co-authored-by: Natalia Tepluhina --- src/api/options-assets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/options-assets.md b/src/api/options-assets.md index 361c530ec7..134a4482f4 100644 --- a/src/api/options-assets.md +++ b/src/api/options-assets.md @@ -10,7 +10,7 @@ - **Usage:** ```js - const App = Vue.createApp() + const app = Vue.createApp({}) app.component('focused-input', { directives: { From 35167ae8cd537de2c77707fa081168f2b9cd3994 Mon Sep 17 00:00:00 2001 From: Stanislav Lashmanov Date: Mon, 20 Jul 2020 16:25:56 +0300 Subject: [PATCH 3/3] Update src/api/options-assets.md Co-authored-by: Natalia Tepluhina --- src/api/options-assets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/options-assets.md b/src/api/options-assets.md index 134a4482f4..3c43d59904 100644 --- a/src/api/options-assets.md +++ b/src/api/options-assets.md @@ -40,7 +40,7 @@ template: `
Foo
` } - const App = Vue.createApp({ + const app = Vue.createApp({ components: { Foo },