# unplugin-layui-vue-resolver

> layui-vue 按需加载 unplugin 插件

Latest version **0.0.13** (published 2022-07-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install unplugin-layui-vue-resolver
pnpm add unplugin-layui-vue-resolver
yarn add unplugin-layui-vue-resolver
bun add unplugin-layui-vue-resolver
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2022-07-07 |
| First published | 2022-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sight |
| Maintainers | morning-star |
| Keywords | layui-vue |

## Links

- npm: https://www.npmjs.com/package/unplugin-layui-vue-resolver
- npm.io page: https://npm.io/package/unplugin-layui-vue-resolver

## Recent versions

- 0.0.13 (latest) — 2022-07-07
- 0.0.12 — 2022-05-15
- 0.0.11 — 2022-05-14
- 0.0.10 — 2022-05-07
- 0.0.9 — 2022-05-07
- 0.0.8 — 2022-05-06
- 0.0.7 — 2022-04-26
- 0.0.6 — 2022-04-26
- 0.0.5 — 2022-04-25
- 0.0.4 — 2022-04-25
- 0.0.3 — 2022-04-25
- 0.0.2 — 2022-04-24
- 0.0.1 — 2022-04-24

## README

## layui-vue 按需引入插件示例

### 快速开始
```
// 安装依赖
pnpm install

// 运行
pnpm dev
```

### 按需导入插件说明

- 安装 `unplugin-vue-components` 和 `unplugin-auto-import` 

```
npm install -D unplugin-vue-components unplugin-auto-import unplugin-layui-vue-resolver
```

- Vite 配置
```
// vite.config.ts
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { LayuiVueResolver } from 'unplugin-layui-vue-resolver'

export default {
  plugins: [
    // ...其它插件配置
    
    // 自动导入 layer-vue 相关函数,例如 指令,layer 等
    AutoImport({
      resolvers: [LayuiVueResolver()],
    }),
    // 自动解析 layui-vue 组件
    Components({
      resolvers: [LayuiVueResolver()],
    }),
  ],
}

```

- LayuiVueResolver(option: LayuiVueResolverOptions)参数

```
export interface LayuiVueResolverOptions {
  /**
   * import style along with components
   * 将样式与组件一起导入
   *
   * @default 'css'
   */
  importStyle?: boolean | 'css'

  /**
   * resolve `@layui/layui-vue' icons
   * requires package `@layui/icons-vue`
   * 是否解析图标
   *
   * @default false
   */
  resolveIcons?: boolean

  /**
   * exclude components that do not require automatic import
   * 排除不需要自动导入的组件
   * 
   * eg: exclude: ['LayAnchor', /^LayDoc[A-Z]/,]
   * 
   */
  exclude?: Array<string | RegExp>;
}
```

---
_Source: https://npm.io/package/unplugin-layui-vue-resolver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
