You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/1.v2/1.guide/1.options.md
+34-8Lines changed: 34 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,10 +159,21 @@ Return value is the `config`. `async` is supported.
159
159
|`async`|`Boolean`|| Components are loaded asynchronously. If there is more than one entry the async will lead to unwanted webpack chunk splitting. |`false`|
160
160
|`path`|`String`|| Path to the component to be called by the tag. |`false`|
161
161
|`options`|`Function`, `Object`|| Options from custom-element. <br>[Learn more](https://github.com/karol-f/vue-custom-element#options) about `vue-custom-element` options. |`undefined`|
162
-
|`appContext`|`Function`||Function call to extend the Vue app. Example: Plugin registration of `vuetify`, `pinia`, `vue-router`, ...|`undefined`|
162
+
|`appContext`|`String`, `Function`||File Reference or Function call to extend the Vue app. Example: Plugin registration of `vuetify`, `pinia`, `vue-router`, ... |`undefined`|
163
163
|`css`|`String`|| Can be used to inject CSS into the element. |`undefined`|
164
164
|`slotContent`|`String`|| Default slot content for generated html entry output. |`undefined`|
165
165
166
+
#### Example appContext config file
167
+
168
+
```js
169
+
exportdefaultfunction (Vue) {
170
+
// Customize Vue App here
171
+
// e.g. Vue.component('my-component', MyComponent) or Vue.use(MyPlugin)
172
+
173
+
console.log('Vue App', Vue);
174
+
}
175
+
```
176
+
166
177
#### Important
167
178
168
179
1. You can set as `object` or when using functions in options, use `function`.
@@ -200,12 +211,28 @@ Return value is the `config`. `async` is supported.
200
211
}
201
212
```
202
213
203
-
2. You can extend the Vue app to install plugins, for example. (e.g. `vuetify`, `pinia`, `vue-18n`, `vue-router`)
214
+
2. You can customize the Vue app to install plugins, for example. (e.g. `vuetify`, `pinia`, `vue-18n`, `vue-router`)
204
215
205
216
```js
206
217
{
207
218
name:'ComponentAppExample',
208
219
tags: [
220
+
// Recommended to control appContext via config file.
0 commit comments