Nuxt/packages/nuxt/src/app/components/dev-only.ts

12 lines
237 B
TypeScript
Raw Normal View History

2022-10-26 12:43:37 +00:00
import { defineComponent } from 'vue'
export default defineComponent({
name: 'DevOnly',
setup (_, props) {
if (import.meta.dev) {
2022-10-26 12:43:37 +00:00
return () => props.slots.default?.()
}
return () => props.slots.fallback?.()
2022-10-26 12:43:37 +00:00
}
})