File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
docs/content/3.components Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -188,10 +188,26 @@ name: 'toast-orientation-example'
188
188
189
189
## Examples
190
190
191
+ :: note { to =" /components/app " }
192
+ Nuxt UI provides an ** App** component that wraps your app to provide global configurations.
193
+ ::
194
+
191
195
### Change global position
192
196
193
197
Change the ` toaster.position ` prop on the [ App] ( /components/app#props ) component to change the position of the toasts.
194
198
199
+ ``` vue [app.vue]
200
+ <script setup lang="ts">
201
+ const toaster = { position: 'bottom-right' }
202
+ </script>
203
+
204
+ <template>
205
+ <UApp :toaster="toaster">
206
+ <NuxtPage />
207
+ </UApp>
208
+ </template>
209
+ ```
210
+
195
211
:: component-example
196
212
---
197
213
prettier: true
@@ -210,6 +226,18 @@ In this example, we use the `AppConfig` to configure the `position` prop of the
210
226
211
227
Change the ` toaster.duration ` prop on the [ App] ( /components/app#props ) component to change the duration of the toasts.
212
228
229
+ ``` vue [app.vue]
230
+ <script setup lang="ts">
231
+ const toaster = { duration: 5000 }
232
+ </script>
233
+
234
+ <template>
235
+ <UApp :toaster="toaster">
236
+ <NuxtPage />
237
+ </UApp>
238
+ </template>
239
+ ```
240
+
213
241
:: component-example
214
242
---
215
243
prettier: true
@@ -232,6 +260,18 @@ Set the `toaster.expand` prop to `false` on the [App](/components/app#props) com
232
260
You can hover over the toasts to expand them. This will also pause the timer of the toasts.
233
261
::
234
262
263
+ ``` vue [app.vue]
264
+ <script setup lang="ts">
265
+ const toaster = { expand: true }
266
+ </script>
267
+
268
+ <template>
269
+ <UApp :toaster="toaster">
270
+ <NuxtPage />
271
+ </UApp>
272
+ </template>
273
+ ```
274
+
235
275
:: component-example
236
276
---
237
277
prettier: true
You can’t perform that action at this time.
0 commit comments