File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 8
8
9
9
A hash of directives to be made available to the component instance.
10
10
11
+ - ** Usage:**
12
+ ``` js
13
+ const app = Vue .createApp ({})
14
+
15
+ app .component (' focused-input' , {
16
+ directives: {
17
+ focus: {
18
+ mounted (el ) {
19
+ el .focus ()
20
+ }
21
+ }
22
+ },
23
+ template: ` <input v-focus>`
24
+ })
25
+ ```
26
+
11
27
- ** See also:** [ Custom Directives] ( ../guide/custom-directive.html )
12
28
13
29
## components
18
34
19
35
A hash of components to be made available to the component instance.
20
36
37
+ - ** Usage:**
38
+ ``` js
39
+ const Foo = {
40
+ template: ` <div>Foo</div>`
41
+ }
42
+
43
+ const app = Vue .createApp ({
44
+ components: {
45
+ Foo
46
+ },
47
+ template: ` <Foo />`
48
+ })
49
+ ```
50
+
21
51
- ** See also:** [ Components] ( ../guide/component-basics.html )
You can’t perform that action at this time.
0 commit comments