Support for explicit import global components
See original GitHub issueCan we use
<script setup lang="ts">
import { NuxtLink } from 'some-nuxt-lib-location'
</script>
<template>
<div>
<nuxt-link :to="`/test/123`">
Random path
</nuxt-link>
</div>
</template>
Additional context
We use https://eslint.vuejs.org/rules/no-undef-components.html and all component should be registered locally.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Component Registration - Vue.js
We can make components available globally in the current Vue application using the app.component() method: js import { createApp } from 'vue' const...
Read more >Importing and Using Components in Nuxt 3 - Server Side Up
When migrating from Nuxt 2 to Nuxt 3, components are now imported and used through auto imports instead of explicit importing.
Read more >don't register global components locally on referencing them
When registering as a global component, I do not want to import it. What happens instead? Direct path import and register to components...
Read more >Is it a good practice to import shared sass variables into every ...
When we move components to a different project or repo, due to explicit imports for SCSS variables files, we don't have to worry...
Read more >Advanced usage - Vuelidate
Using component mixin # ; { · } from '@vuelidate/core' import ; { ·, · } from '@vuelidate/validators' ; export default { setup...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What do you think @pi0 - would it be useful to expose a
#components
import for directly importing from scanned components?Not a bug. It’s a feature request or question.
In vue-router, we can use
import { RouterLink, RouterView } from 'vue-router'
see
https://github.com/vuejs/create-vue-templates/blob/284fcf591115e5cf39e4461e2fd4cd2c5ea009bb/typescript-router/src/App.vue#L1-L2
Which lib should I import when I use
<NuxtLink>
?Can I write
import { NuxtLink } from 'nuxt3'
or something else?