Skip to content

Commit 416f2c6

Browse files
authored
refactor: ionic resolver strict components (#660)
1 parent 729d992 commit 416f2c6

File tree

1 file changed

+94
-3
lines changed

1 file changed

+94
-3
lines changed

src/core/resolvers/ionic.ts

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,107 @@
11
import type { ComponentResolver } from '../../types'
22

3+
/**
4+
* source: https://github.com/nuxt-modules/ionic/blob/main/src/imports.ts
5+
* @author @danielroe
6+
*/
7+
export const IonicBuiltInComponents = [
8+
'IonAccordion',
9+
'IonAccordionGroup',
10+
'IonActionSheet',
11+
'IonAlert',
12+
'IonApp',
13+
'IonAvatar',
14+
'IonBackButton',
15+
'IonBackdrop',
16+
'IonBadge',
17+
'IonBreadcrumb',
18+
'IonBreadcrumbs',
19+
'IonButton',
20+
'IonButtons',
21+
'IonCard',
22+
'IonCardContent',
23+
'IonCardHeader',
24+
'IonCardSubtitle',
25+
'IonCardTitle',
26+
'IonCheckbox',
27+
'IonChip',
28+
'IonCol',
29+
'IonContent',
30+
'IonDatetime',
31+
'IonDatetimeButton',
32+
'IonFab',
33+
'IonFabButton',
34+
'IonFabList',
35+
'IonFooter',
36+
'IonGrid',
37+
'IonHeader',
38+
'IonIcon',
39+
'IonImg',
40+
'IonInfiniteScroll',
41+
'IonInfiniteScrollContent',
42+
'IonInput',
43+
'IonItem',
44+
'IonItemDivider',
45+
'IonItemGroup',
46+
'IonItemOption',
47+
'IonItemOptions',
48+
'IonItemSliding',
49+
'IonLabel',
50+
'IonList',
51+
'IonListHeader',
52+
'IonLoading',
53+
'IonMenu',
54+
'IonMenuButton',
55+
'IonMenuToggle',
56+
'IonModal',
57+
'IonNav',
58+
'IonNavLink',
59+
'IonNote',
60+
'IonPage',
61+
'IonPicker',
62+
'IonPopover',
63+
'IonProgressBar',
64+
'IonRadio',
65+
'IonRadioGroup',
66+
'IonRange',
67+
'IonRefresher',
68+
'IonRefresherContent',
69+
'IonReorder',
70+
'IonReorderGroup',
71+
'IonRippleEffect',
72+
'IonRouterOutlet',
73+
'IonRow',
74+
'IonSearchbar',
75+
'IonSegment',
76+
'IonSegmentButton',
77+
'IonSelect',
78+
'IonSelectOption',
79+
'IonSkeletonText',
80+
'IonSpinner',
81+
'IonSplitPane',
82+
'IonTabBar',
83+
'IonTabButton',
84+
'IonTabs',
85+
'IonText',
86+
'IonTextarea',
87+
'IonThumbnail',
88+
'IonTitle',
89+
'IonToast',
90+
'IonToggle',
91+
'IonToolbar',
92+
]
93+
394
/**
495
* Resolver for ionic framework
596
*
6-
* @author @mathsgod
7-
* @link https://github.com/mathsgod
97+
* @author @mathsgod @reslear
98+
* @link https://ionicframework.com/
899
*/
9100
export function IonicResolver(): ComponentResolver {
10101
return {
11102
type: 'component',
12103
resolve: (name: string) => {
13-
if (name.startsWith('Ion')) {
104+
if (IonicBuiltInComponents.includes(name)) {
14105
return {
15106
name,
16107
from: '@ionic/vue',

0 commit comments

Comments
 (0)