Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 26, 2022
1 parent b6e8c83 commit e92889b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/content/2.guide/2.directory-structure/1.components.md
Expand Up @@ -225,7 +225,9 @@ This feature only works with Nuxt auto-imports and `#components` imports. Explic

## `<DevOnly>` Component

Nuxt also provides a `<DevOnly>` component to render a component only during development. The content will not be included in production builds.
Nuxt provides the `<DevOnly>` component to render a component only during development.

The content will not be included in production builds and tree-shaken.

```html{}[pages/example.vue]
<template>
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/components/dev-only.mjs
Expand Up @@ -2,9 +2,9 @@ import { defineComponent } from 'vue'

export default defineComponent({
name: 'DevOnly',
setup (_, { slots }) {
setup (_, props) {
if (process.dev) {
return () => slots.default?.()
return () => props.slots.default?.()
}
return () => null
}
Expand Down
2 changes: 0 additions & 2 deletions playground/app.vue
Expand Up @@ -5,8 +5,6 @@
<!-- Edit this file to play around with Nuxt but never commit changes! -->
<div>
Nuxt 3 Playground

<DevOnly>Development mode</DevOnly>
</div>
</template>

Expand Down

0 comments on commit e92889b

Please sign in to comment.