File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
packages/core/src/_resolvers Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ export * from './uni-ui'
33export * from './wot-design-uni'
44export * from './uv-ui'
55export * from './uview-pro'
6+ export * from './z-paging'
Original file line number Diff line number Diff line change 1+ import type { FilterPattern } from '@rollup/pluginutils'
2+ import type { ComponentResolver } from '../types'
3+ import { isExclude , kebabCase } from '../utils'
4+
5+ export interface ZPagingResolverOptions {
6+ /**
7+ * RegExp or string to match component names that will NOT be imported
8+ */
9+ exclude ?: FilterPattern
10+ }
11+
12+ export function ZPagingResolver (
13+ options : ZPagingResolverOptions = { } ,
14+ ) : ComponentResolver {
15+ return {
16+ type : 'component' ,
17+ resolve : ( name : string ) => {
18+ if ( isExclude ( name , options . exclude ) )
19+ return
20+
21+ if ( name . match ( / ^ (? ! Z P a g i n g R e f r e s h | Z P a g i n g L o a d M o r e ) Z P a g i n g ( .* ) / ) ) {
22+ const compName = kebabCase ( name )
23+ return {
24+ name,
25+ from : `z-paging/components/${ compName } /${ compName } .vue` ,
26+ }
27+ }
28+ } ,
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments