diff --git a/README.md b/README.md index c930e0d9..2f067bde 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ Supported Resolvers: - [Headless UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/headless-ui.ts) - [IDux](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/idux.ts) - [Inkline](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/inkline.ts) +- [Ionic](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/ionic.ts) - [Naive UI](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/naive-ui.ts) - [Prime Vue](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/prime-vue.ts) - [Quasar](https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/quasar.ts) diff --git a/src/core/resolvers/index.ts b/src/core/resolvers/index.ts index cbfd1be7..ea5c4220 100644 --- a/src/core/resolvers/index.ts +++ b/src/core/resolvers/index.ts @@ -19,3 +19,4 @@ export * from './arco' export * from './tdesign' export * from './layui-vue' export * from './bootstrap-vue' +export * from './ionic' diff --git a/src/core/resolvers/ionic.ts b/src/core/resolvers/ionic.ts new file mode 100644 index 00000000..7b816930 --- /dev/null +++ b/src/core/resolvers/ionic.ts @@ -0,0 +1,21 @@ +import type { ComponentResolver } from '../../types' + +/** + * Resolver for ionic framework + * + * @author @mathsgod + * @link https://github.com/mathsgod + */ +export function IonicResolver(): ComponentResolver { + return { + type: 'component', + resolve: (name: string) => { + if (name.startsWith('Ion')) { + return { + name, + from: '@ionic/vue', + } + } + }, + } +}