Skip to content

How to use icons in both .vue files and .jsx files? #311

Closed

Description

@wjw020206

The icon displays normally in .vue, but not in .jsx. How should I configure it to display in .vue and .jsx at the same time?

export default [
  vue(),
  vueJsxPlugin(),
  AutoImport({
    resolvers: [ElementPlusResolver()],
    imports: ['vue', 'vue-router', 'pinia'],
    dirs: ['src/store/**/*'],
    vueTemplate: true,
    defaultExportByFilename: false,
    dts: './config/auto-imports.d.ts',
    eslintrc: {
      enabled: true,
      filepath: './config/.eslintrc-auto-import.json',
      globalsPropValue: true
    }
  }),
  Components({
    resolvers: [
      ElementPlusResolver(),
      VueUseComponentsResolver(),
      IconsResolver({
        prefix: false,
        enabledCollections: ['ep']
      })
    ],
    dirs: ['src/components', 'src/layouts'],
    directoryAsNamespace: false,
    dts: './config/components.d.ts'
  }),
  Icons({
    autoInstall: true,
    compiler: 'vue3'
  })
];

Activity

  1. locked and limited conversation to collaborators on Oct 8, 2023
  2. converted this issue into a discussion #313 on Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions