File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export default {
61
61
If you want all instances of Vue Select to use your custom components throughout your app, while
62
62
only having to set the implementation once, you can do so when registering Vue Select as a component.
63
63
64
+ ## Vue 2x
64
65
``` js
65
66
import Vue from ' vue' ;
66
67
import vSelect from ' vue-select' ;
@@ -79,5 +80,25 @@ vSelect.props.components.default = () => ({
79
80
Vue .component (vSelect)
80
81
```
81
82
83
+ ## Vue 3x
84
+ ``` js
85
+ import {createApp , h } from ' vue' ;
86
+ import vSelect from ' vue-select' ;
87
+
88
+ // Set the components prop default to return our fresh components
89
+ vSelect .props .components .default = () => ({
90
+ Deselect: {
91
+ render : () => h (' span' , ' ❌' ),
92
+ },
93
+ OpenIndicator: {
94
+ render : () => h (' span' , ' 🔽' ),
95
+ },
96
+ });
97
+
98
+ // Register the component
99
+ const app = createApp (App);
100
+ app .component (' vSelect' , vSelect);
101
+ ```
102
+
82
103
<CustomComponentRegistration />
83
104
You can’t perform that action at this time.
0 commit comments