There are tsx and vue files in the project, can't both files be automatically imported?
See original GitHub issueIn the .vue file, it works fine
// vite.config.ts
IconsResolver({
enabledCollections: ['ep']
})
But in tsx, I tried to write like this, but it didn’t work😢
// vite.config.ts
plugins: [
Icons({
jsx: 'react', // 'react' or 'preact'
compiler: 'jsx', // 'vue2', 'vue3', 'jsx'
}),
// Api自动导入
AutoImport({
resolvers: [
IconsResolver({
prefix: 'i', // 图标前缀,默认为i
enabledCollections: ['ep'],
extension: 'jsx',
}),
],
}),
// 按需导入组件
Components({
resolvers: [
// 自动注册图标组件
IconsResolver({
prefix: 'i', // 图标前缀,默认为i
extension: 'jsx',
enabledCollections: ['ep'],
}),
],
}),
],
Issue Analytics
- State:
- Created a year ago
- Comments:21
Top Results From Across the Web
Cannot import from a typescript Vue component into ... - GitHub
Both components are writting in Typescript. NOTE: I can import the TS vue component into another TS file, i.e., App.vue into example.ts.
Read more >Vue with TSX - the perfect duo!? - Arek Nawo
Take a look at an example component (TSX + Composition API): import { defineComponent } from "vue"; import HelloWorld from "./components/ ...
Read more >How to remove .vue extension from imports when using ...
This is why you need the .vue extension: if you remove it, Typescript doesn't know the type of the file and can't compile....
Read more >Importing Components in React From Other Files - Upmostly
In React, importing is the same as in vanilla JavaScript. ... In the file App.js automatically generated by the create-react-app command:.
Read more >TypeScript Compiling with Visual Studio Code
A tsconfig.json file defines the TypeScript project settings, such as the ... To exclude JavaScript files generated from both .ts and .tsx source...
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
@userquin OK, thank you very much!👍🥰
@userquin thank you, my friend. However, you need to wait for a while, I will provide you with it when I get home from getting off work later~ 😂
about an hour later…