/unplugin-auto-import-element-plus-preset

A Simple Preset for unplugin-auto-import.

Primary LanguageTypeScript

A Simple Preset for unplugin-auto-import.

Use type.d.ts

tsconfig.json

{
    "compilerOptions": {
        ...
        "types": [
            ...
            "unplugin-auto-import-element-plus-preset/type"
        ]
    }
}

Use Preset (No Style)

// vite.config.ts
import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import ElementPlusPreset from 'unplugin-auto-import-element-plus-preset'

export default defineConfig({
    ...
    plugins: [
        ...
        AutoImport({
            imports: [
                ElementPlusPreset
            ]
        })
    ]
})
// <script lang="ts" setup>
const schemas = [
    {
        prop: 'text',
        component: ElInput // don't need to care tsc error
    }
]